Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
share|improve this question

2 Answers 2

up vote 1 down vote accepted

That's the wrong path. That's the login profile for the system account (Couldn't find any direct documentation, but this makes mention of that fact). That's the account that system servers will run, but it won't run for interactive users.

The startup folder for your account is in:

c:\Documents And Settings\{Your User Name}\Start Menu\Programs\Startup

Or if you want it to run for all logins, but it into:

c:\Documents And Settings\All Users\Start Menu\Programs\Startup
share|improve this answer
    
Note that this runs on login, not startup. The key difference is that after login, you run in the security context of the logged-in user. –  MSalters Mar 28 '11 at 14:59
    
what's the diff , anyway I need to login ? –  jon Mar 28 '11 at 15:07

Start > Run> gpedit.msc will open the Group Policy editor where you can set up scripts to run on user logon.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.