PDA

View Full Version : Running on startup no longer works!



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.

Goldenclaw
08-16-2006, 09:16 AM
Nothing seems to work anymore in my batch files! I tried moving everything to C:\ so there wouldn't be any spaces, but then the file itself wouldn't even work. When using the %random% value in a loop to copy files, the computer arbitrarily fails to open the .bat, assigns it only one number, or manages to lose the file I'm copying completely. This is odd because it only gets dicked around on startup. If I manually open the batch file, everything works perfectly.

Goldenclaw
08-17-2006, 07:42 PM
got it fixed

I needed double the quotes, ie., I needed "/"datajunk/"".