PDA

View Full Version : Disk Maintenance Parameters (Win 98)


D_Spider
08-21-2004, 03:21 AM
But then again, this is Microsoft we are talking about, and is anything ever consistent with them?
__________________
Crash Override

Naively believing that computers exist to do things more easily and faster than having humans do them, I finally found the secret parameters that allow one to run Scandisk and then Defrag without being present. (If you don't use these parameters, Defrag tells you that the "drive is locked by a disk utility; exit the disk utility before re-starting Disk Defragmenter," but Defrag doesn't tell you that the offending disk utility is Scandisk nor that Scandisk locks the drive after it's finished and until you click on "yes" to "Do you want to exit Scandisk?") Using a scheduler, you put the parameters in the parameter box or, if there isn't a parameter box, you put the parameters after the filename, leaving one letter-space before each drive letter or parameter.

Okay. You run Scandisk first. You browse to get the path and filename:
C:\WINDOWS\SCANDSKW.EXE

Then you identify the drive you want scanned by putting its letter and a colon after the filename:
C:\WINDOWS\SCANDSKW.EXE C:
If you have two hard drives, you put in the parameter "/all":
C:\WINDOWS\SCANDSKW.EXE /ALL

Then you use a parameter that tells Scandisk to start without waiting for you to click on "yes" ("/n" means the same as "/noninteractive"; you can use either, and case doesn't matter):
C:\WINDOWS\SCANDSKW.EXE /ALL /n

Since you've told Windows "noninteractive," you may think it listened; well, it half-way did, but for it to close Scandisk completely, you have to use another parameter that means "no, I don't want to see a summary window after Scandisk is done":
C:\WINDOWS\SCANDSKW.EXE /ALL /n /silent

Now Scandisk will run at the time you tell it, it will not require you to start it by clicking "yes," and it will not lock the drive(s) when it is done; it will run and then politely take itself off your screen

. . . so that Defrag can run at its appointed time. As with Scandisk, you browse to get the path and filename, and you add the drive letter or the "/all" parameter:
C:\WINDOWS\DEFRAG.EXE C: <or> C:\WINDOWS\DEFRAG.EXE /all (case doesn't matter)

Now, here is where the quoted "text" for this "sermon," above, becomes relevant. Since you told Defrag what drive(s) to defragment, (unlike Scandisk) it doesn't need to ask your permission before it begins, so (unlike Scandisk) it doesn't need the "/noninteractive" parameter. But (like Scandisk) it won't leave the screen unless you tell it to. And to do that, you can't just tell it "/silent" but have to use Defrag's own parameter, which is "/noprompt." So you add it:
C:\WINDOWS\DEFRAG.EXE C: /noprompt <or> C:\WINDOWS\DEFRAG.EXE /all /noprompt

Before running scandisk "/silent " you should run it normally with the parameters you intend to use when you let it run itself. See oftentired's too-modestly-said advice below.

By telling Windows
C:\WINDOWS\SCANDSKW.EXE /ALL /n /silent <and>
C:\WINDOWS\DEFRAG.EXE /all /noprompt
you can let your computer take care of its own disk maintenance. Which it can do a lot more easily, it seems, than Microsoft's programmers can agree on parameters.

randiroo76073
08-21-2004, 07:14 AM
Thanks D Spider, and to think all M$ prgrammers had to do was give us a couple of ckboxes to work with,but noooo! not only do we have to pay for M$ prgms, we have to become prgrammers and rewrite em to use them effectivly :[

oftentired
08-21-2004, 03:33 PM
I loved that logic trail :jig:

Applicable OS: Win9x

Before running scandisk /silent a user should consider running it normally (e.g. not from a command line) in order to set the Advanced settings to their particular preferences. Any non-default preferences won't be remembered unless you actually run a scandisk check so just setting them and closing the window doesn't do it. Once you have done this there is no need to do it again unless a change in preferences is desired.

For example you may want to delete file fragments rather than cluttering your harddrive with anonymous useless files. Scandisk default is to save them to disk.

Alternatively you can modify the Scandisk.ini file (instructions are in the file itself) and use the /custom switch in addition to the other switches suggested.

Command-Line Parameters for the Scandisk Tool (http://support.microsoft.com/default.aspx?scid=kb;en-us;199557)
:)