How can I make a VB script execute every time Windows starts up?
- by jon
My goal is to copy INI.file each time Windows XP is started up or rebooted.
The following VB script copies INI.file from a local directory to C:\INI_DIR.
I tried to copy the VB script to C:\WINDOWS\system32\config\systemprofile\Start Menu\Programs\Startup, but it doesn't get activated. Is it not the right path? How can I make it execute on startup/reboot?
The script:
Dim currDir
Const OverwriteExisting = True
Set fso = CreateObject("Scripting.FileSystemObject")
currDir = fso.GetParentFolderName(Wscript.ScriptFullName)
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile currDir & "\INI.file" , "C:\INI_DIR" , OverwriteExisting
' Release the objFSO objects
Set objFSO = Nothing
' Release the fso objects
Set fso = Nothing