batch script problem

Discussion in 'Software' started by zero0, Apr 3, 2010.

  1. zero0

    zero0 Private E-2

    Hi

    I try to create small batch to export some regedit keys to text notepad called 666.txt

    this is my batch

    Code:
    @echo off
    reg export "hklm\software\microsoft\windows\currentversion\explorer\browser helper objects" c:\666.txt
    echo ====================================================================================== c:\666.txt
    reg export "hklm\software\microsoft\internet explorer\toolbar" c:\666.txt 

    it is not work very well :( and give me this output only

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\software\microsoft\internet explorer\toolbar]
    
    any body can resolve this problem, i appreciate any help

    thank you
     
  2. Mada_Milty

    Mada_Milty MajorGeek

    There are a couple ways of redirecting command-line output to a text file.

    First is to use a > between the command and the file name. This creates a new file, and places the output into it.

    Second is to use >> between the command and the file name. This will create a new file if one doesn't already exists, and places the output into it. If the file does exist, the command's output is appended to the file.

    I suspect that since you're using neither redirection operator, that it is probably defaulting to the first (except on your echo lines, I expect the file path is being echo'ed as well on those). Try adding >> between command and file name. :)
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds