1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Run Reg File Silently from Batch File

Discussion in 'Windows XP' started by Thomas M., Aug 19, 2010.

  1. Thomas M.

    Thomas M. Flightless Bird

    Windows XP SP3

    I have the following in a .REG file:

    Windows Registry Editor Version 5.00

    [HKEY_USERS\.DEFAULT\Control Panel\Desktop]
    "AutoEndTasks"="0"

    I am just using this value as a test and I toggle it between 0 and 1.
    I would like to develop a batch file that runs the .REG file
    silently. Toward that end, I have placed the following command in a
    batch file:

    regedit.exe /s AutoEndTasks.reg

    This works if I type it at the command prompt. However, if I put it
    in a batch file and then run that batch file from the command prompt,
    I get the following error:

    C:/>â– r
    'â– r' is not recognized as an internal or external command,
    operable program or batch file.

    I have made sure that REGEDIT.EXE and the .REG file are both found in
    the path.

    My understanding is that what I want to accomplish--using the batch
    file to run the .REG file silently--should be doable. I just can't
    figure out why it doesn't work.

    Any help will be greatly appreciated!

    --Tom
     
  2. Pegasus [MVP]

    Pegasus [MVP] Flightless Bird

    "Thomas M." <thomasm516@gmail.com> wrote in message
    news:f5f5a5d0-7c0a-404e-bdcd-30f9f6610a7d@q22g2000yqm.googlegroups.com...
    > Windows XP SP3
    >
    > I have the following in a .REG file:
    >
    > Windows Registry Editor Version 5.00
    >
    > [HKEY_USERS\.DEFAULT\Control Panel\Desktop]
    > "AutoEndTasks"="0"
    >
    > I am just using this value as a test and I toggle it between 0 and 1.
    > I would like to develop a batch file that runs the .REG file
    > silently. Toward that end, I have placed the following command in a
    > batch file:
    >
    > regedit.exe /s AutoEndTasks.reg
    >
    > This works if I type it at the command prompt. However, if I put it
    > in a batch file and then run that batch file from the command prompt,
    > I get the following error:
    >
    > C:/>â– r
    > 'â– r' is not recognized as an internal or external command,
    > operable program or batch file.
    >
    > I have made sure that REGEDIT.EXE and the .REG file are both found in
    > the path.
    >
    > My understanding is that what I want to accomplish--using the batch
    > file to run the .REG file silently--should be doable. I just can't
    > figure out why it doesn't work.
    >
    > Any help will be greatly appreciated!
    >
    > --Tom


    Your batch file is probably a Unicode rather than an ASCII file. Click "Save
    as", then make sure you select the correct file type.
     
  3. MikeS

    MikeS Flightless Bird

    Try including the full Windows path for both regedit.exe and your reg file,
    eg
    c:/windows\regedit.exe /s "c:/myprog\AutoEndTasks.reg"

    "Thomas M." <thomasm516@gmail.com> wrote in message
    news:f5f5a5d0-7c0a-404e-bdcd-30f9f6610a7d@q22g2000yqm.googlegroups.com...
    Windows XP SP3

    I have the following in a .REG file:

    Windows Registry Editor Version 5.00

    [HKEY_USERS\.DEFAULT\Control Panel\Desktop]
    "AutoEndTasks"="0"

    I am just using this value as a test and I toggle it between 0 and 1.
    I would like to develop a batch file that runs the .REG file
    silently. Toward that end, I have placed the following command in a
    batch file:

    regedit.exe /s AutoEndTasks.reg

    This works if I type it at the command prompt. However, if I put it
    in a batch file and then run that batch file from the command prompt,
    I get the following error:

    C:/>?r
    '?r' is not recognized as an internal or external command,
    operable program or batch file.

    I have made sure that REGEDIT.EXE and the .REG file are both found in
    the path.

    My understanding is that what I want to accomplish--using the batch
    file to run the .REG file silently--should be doable. I just can't
    figure out why it doesn't work.

    Any help will be greatly appreciated!

    --Tom
     
  4. Thomas M.

    Thomas M. Flightless Bird

    On Aug 19, 11:50 pm, "Pegasus [MVP]" <n...@microsoft.com> wrote:

    > Your batch file is probably a Unicode rather than an ASCII file. Click "Save
    > as", then make sure you select the correct file type.- Hide quoted text -
    >
    > - Show quoted text -


    That solved the problem. Thanks for the help!

    --Tom
     

Share This Page