Items in Startup folder don't start on bootup

G

Guest

Note: This is not an unattended install question. Please read the entire
message:

During unattended install, I add a command to the RunOnce (<CommandLine> in
unattend.xml):
CMD.EXE /C COPY C:\TOOLS\WinRun.bat
C:\Users\ADMINI~1\AppData\Roaming\MICROS~1\Windows\STARTM~1\Programs\Startup\WinRun.bat

This does not work. The batch file never gets copied. However I can run this
exact same command in the Start/Run box, and it copies just fine.

I also tried this command:
CMD.EXE /C COPY C:\TOOLS\WinRun.bat
C:\PROGRA~2\Microsoft\Windows\STARTM~1\Programs\Startup\WinRun.bat

This one works just fine. However, my VB6 program uses a built-in function
to obtain the Startup folder path:
strStartupFolder = objShell.SpecialFolders("Startup") & "\"

The path returned by objShell.SpecialFolders("Startup")in Vista is the
previous path that I was using initially (the one that does not work):
C:\Users\ADMINI~1\AppData\Roaming\MICROS~1\Windows\STARTM~1\Programs\Startup\

So when I try to delete the WinRun.bat file from the Startup folder
designated by the VB6 SpecialFolders command (so it doesn't run on every
reboot), the batch file doesn't get deleted, and it runs on every boot.

I guess I can hard-code the path for now, but I'd like a more reasonable
solution.

Thanks,
 
G

Guest

Perhaps instead of using the startup folder use the runonce key in the
registry.

( HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce )

You can use the reg command to do this. Type reg /? in a cmd prompt for help.
 

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