How can I make a VB script execute every time Windows starts up?

Posted by jon on Super User See other posts from Super User or by jon
Published on 2011-03-28T14:13:00Z Indexed on 2012/12/15 17:07 UTC
Read the original article Hit count: 267

Filed under:

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

© Super User or respective owner

Related posts about windows-xp