Run Reg File Silently from Batch File

T

Thomas M.

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
 
P

Pegasus [MVP]

Thomas M. said:
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.
 
M

MikeS

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

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
 
T

Thomas M.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top