Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run chkdsk at startup 2

Status
Not open for further replies.

mvee

Programmer
Aug 1, 2000
22
0
0
US
I have read many a message requesting information on how to STOP chkdsk from running at startup, however, I'd like to MAKE chkdsk run at startup on all of our W2K Pro machines.

I know how to make chkdsk run with the various switches (/f, /r, /c, /i, etc) from the command prompt or by using a batch file. But I'd like to not have to set this everyday, I'd like to just make a entry in the autoexec.nt file or something that says run chkdsk /f while starting up the computer.

Does anyone know how to do this?
Thanks, Megan
 
You can try to include check disk in the task scheduler. Set to run at startup... Should be located in <driveletter>:\winnt\system32.
Eryctus
 
CHKDSK.exe is located in \\winnt\system32 path above.. Task Scheduler is under start/accessories/system tools.
Hope this is helpful Megan.
E
 
Megan,
I think that in order to run chkdsk with a switch (like, chkdsk /f) you'll have to use the &quot;<&quot; switch.
The command would read something like &quot;c:\chkdsk /f<cr&quot; where cr is a file that contains just the letter &quot;y&quot; and a carriage return. This is because if you type chkdsk /f at a prompt or include it in a batch file, the process will hang, just waiting for you to press y or n (for yes or no) and enter. I can show you how its done if you're interested.

-L
 
L-
Thanks for the helpful hint, unfortunately, I figured that much out a couple days ago. That code is great if I want to shoot out a batch file that assigns the computer the chkdsk command and reboots the computer in the middle of the night. But what about all of our notebook users?

I'd like to run chkdsk at startup as eryctus suggested, but I can't find the code to allow me to schedule a task at startup via a batch file or logon script. I know how to set it at 2am and I know how to use the scheduler wizard to make it run at startup (just discovered that today), but not via code.

Any suggestions?
Thanks, Megan
 
Megan,

I guess I just don't know the answer. :(
Unfortunately, no matter what solution looks more appealing, the pc will have to be rebooted for chkdsk /f to run, scheduled or otherwise (so much for laptop users!)
If by &quot;via code&quot; you mean by an sms package, I'm not of much use.

Lawrence
 
Thanks anyway! Guess I'll just have to do it the long way (go to everyone's machine and set it up using the scheduler wizard). FYI: not necessary to run chkdsk /f on startup, just chkdsk, as I am planning on running chkdsk /r once a month in the middle of the night or when necessary via a batch file.

Thanks again,
Megan
 
Wait! Just stumbled across the chkntfs command. Is native to w2k, here's the pasted help output:
H:\>chkntfs /?
Displays or modifies the checking of disk at boot time.

CHKNTFS volume [...]
CHKNTFS /D
CHKNTFS /T[:time]
CHKNTFS /X volume [...]
CHKNTFS /C volume [...]

volume Specifies the drive letter (followed by a colon),
mount point, or volume name.
/D Restores the machine to the default behavior; all drives are
checked at boot time and chkdsk is run on those that are
dirty.
/T:time Changes the AUTOCHK initiation count down time to the
specified amount of time in seconds. If time is not
specified, displays the current setting.
/X Excludes a drive from the default boot-time check. Excluded
drives are not accumulated between command invocations.
/C Schedules a drive to be checked at boot time; chkdsk will run
if the drive is dirty.

If no switches are specified, CHKNTFS will display if the specified drive is
dirty or scheduled to be checked on next reboot.

Seems to me that you could use chkntfs /d in an w2k AT command (requires the Schedule service to be started) to do what you want.

Seems to work so far ...


-Lawrence
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top