Computing.Net > Forums > Programming > Reg in batch help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Reg in batch help

Reply to Message Icon

Name: MikeSwim07
Date: October 25, 2008 at 16:37:12 Pacific
OS: Windows XP Home
CPU/Ram: 512mb
Product: Dell
Comment:

I have this command in my batch file,

reg ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v Test123 /d "%Systemdrive%\test123.bat" /f

And it doesn't add it to the registry, why?

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: October 25, 2008 at 19:49:30 Pacific
Reply:

Without an error message to go by, how could we know?


0

Response Number 2
Name: MikeSwim07
Date: October 26, 2008 at 04:45:26 Pacific
Reply:

Error: Too many command-line parameters


0

Response Number 3
Name: Razor2.3
Date: October 26, 2008 at 07:40:46 Pacific
Reply:

E:\>reg ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v Test123 /d "%Systemdrive%\test123.bat" /f

The operation completed successfully


It works fine for me. The only thing that comes to mind is if %SystemDrive% already has quotes, but I've never heard of that.

0

Response Number 4
Name: MikeSwim07
Date: October 26, 2008 at 09:22:45 Pacific
Reply:

I got it to work. Thanks

For some reason though, it's adding the name when I go to msconfig. Instead of Test123, it's adding test123.bat.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Reg in batch help

Numbers and basic math in BATCH www.computing.net/answers/programming/numbers-and-basic-math-in-batch/20285.html

%DATE% in batch files with win98 www.computing.net/answers/programming/date-in-batch-files-with-win98/4007.html

Nesting variables in batch files ? www.computing.net/answers/programming/nesting-variables-in-batch-files-/14334.html