Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Script for Defrag, Chkdsk, and Log Events

Feb 13, 2007 4:09AM PST

I am trying to create a VBS script that will Chkdsk available drives, and then defrag them and log the event at the end. I have tried a few scripts, but I am still fairly new to the idea and I don't have time to run around defragging and scanning all the drives in my network.
This is the general idea of how want the script to work:

Checkdisk c: if not go to event log command otherwise go to checkdsk d:
Checkdisk d: see if the drive is there and if it is? check it. If its not then move to defrag.

Defrag c: if not go to event log

Defrag d if its there. If not go to event log command.
End

I work for an IT company that supports and maintains over 150+ clients networks.

Discussion is locked

- Collapse -
i wish i could do that, sheesh
Feb 13, 2007 10:18AM PST

but for now i just use batch programs that open up device manager, etc.

its all about putting the correct switch into tha program...impossible to find out w/o trial&error

- Collapse -
NOT quite sure if this is what you are looking for
Feb 13, 2007 6:33PM PST