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

40% accept rate
feedback

2 Answers

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
link|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
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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