chkdsk 'ing partitions on startup

R

Rob

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
 
W

Wesley Vogel

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
 
R

Rock

Rob said:
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.

fsutil dirty query C:
Queries the status of the volumes dirty bit. When XP boots it calls
Autochk.exe to check the dirty bet. if it's set then Autochk initiates a
check of the disk with chkdsk /f.

You can set the dirty bit with this command:
fsutil dirty set C:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top