Goldenclaw
08-12-2006, 06:39 PM
I need help. Getting a batch file to edit the registry and run something on startup no longer works for me. Here's the code:
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "Testing" /d "%userprofile%\testfile.bat" /f
I did some troubleshooting and found out that the problem lied with the quotation marks. When the above code is executed, the data is put in the registry, but without quotation marks. It looks like this:
C:\Documents and Settings\User\blah
Upon reboot, quotation marks are automatically added to the data, so it looks like this:
"C:\Documents" and Settings\User\blah
I have no idea how or why this is happening. I've tested it on all three computers in my house, and they all do the exact same thing. The weird part is, I've gotton it to work in the past. Code that I had written and tested no more than five days ago no longer works.
I'd greatly appreciate help.
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "Testing" /d "%userprofile%\testfile.bat" /f
I did some troubleshooting and found out that the problem lied with the quotation marks. When the above code is executed, the data is put in the registry, but without quotation marks. It looks like this:
C:\Documents and Settings\User\blah
Upon reboot, quotation marks are automatically added to the data, so it looks like this:
"C:\Documents" and Settings\User\blah
I have no idea how or why this is happening. I've tested it on all three computers in my house, and they all do the exact same thing. The weird part is, I've gotton it to work in the past. Code that I had written and tested no more than five days ago no longer works.
I'd greatly appreciate help.