> How do I get WinXP to execute a batch file during startup?
Place a shortcut to your bat file in either one of these folder...
%allusersprofile%\Start Menu\Programs\Startup
or
%userprofile%\Start Menu\Programs\Startup
Anything in %allusersprofile%\Start Menu\Programs\Startup will run for
whoever logs on.
Anything in %Userprofile%\Start Menu\Programs\Startup will run for whoever
%Userprofile% happens to be.
%userprofile% is an environment variable that is the path to the logged on
user's home folder.
Typing or pasting %userprofile% into the Start | Run box opens to the
Documents and Settings folder on whatever drive it is located on for the
logged in user.
I.e. C:\Documents and Settings\Your Name Here
Or pick a value name and the path to the bat file for the value data in one
of these...
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
or
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Anything in HKEY_LOCAL_MACHINE is machine wide. It doesn't matter who logs
on.
Anything in HKEY_CURRENT_USER relates to the current user that is logged on.
I have these two bat files that run at boot.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Value Name: My Indexdat Killer
Data Type: REG_SZ
Value Data: C:\run.bat
Value Name: Mygetridofstuff
Data Type: REG_SZ
Value Data: "C:\Documents and Settings\Wesley Vogel\My Documents\COMPUTER
DOCUMENTS\Batch Files\Experimental Batch Files\Mygetridofstuff.bat"
--
Hope this helps. Let us know.
Wes
MS-MVP Windows Shell/User
In news:(E-Mail Removed),
Rob <okami1dotwestnetdotcom.au> hunted and pecked:
> Hi all
>
> How do I get WinXP to execute a batch file during startup? I have about a
> dozen partitions on this system, and going through each partitions
> properties to get a chkdsk done at next reboot is tedious: having a batch
> file that can be selectively run or not would be very handy, but I can't
> figure out where to put it. Make the batch file then make a little reg
> file to insert an entry into RunOnce?
>
> I've also found that I can't install the command console because I've
> already installed SP2, that would solve the above problem, if there's a
> way to convince XP to just install the console.
>
> Thanks for any advice
> Rob
|