• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1075
  • Last Modified:

Cannot get REG ADD to work in batch file

Following some things I found online I came up with the following code:

REF ADD HKLM\SYSTEM\ControlSet001\Control /v WaitToKillServiceTimeout /t reg_sz /d 200

Which when run under CMD.EXE (or the command prompt), it works fine.  When I place it by itself in a *.bat file and double click on it, a command window comes up and just keep repeating the command over and over again, but never actually executes it.  What am I missing here?

Also, I know I could do this with a *.reg file, but I need a batch file version for internal reasons.  Any help is greatly appreciated!!
1 Solution
well, i hope the "ref" is just a typo, not a copy/paste.

if the key already exists, try
REG ADD HKLM\SYSTEM\ControlSet001\Control /v WaitToKillServiceTimeout /t REG_SZ /d 200 /f
to force an overwrite.
parkridgelibraryAuthor Commented:
Yes, it was a typo and that worked prefectly!!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now