chkdsk script for servers

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 16 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
jarmar
Posts: 19
Last visit: Tue Jun 23, 2009 11:44 am

chkdsk script for servers

Post by jarmar »

Hello. I am back for some more help. I have tried to use the chkdsk script that you have in the scriptvault but it errors everytime on line 36 char 5 which is

for /F "eol= tokens=1 delims=( " %%i in (DrvLtr.txt) do set DrvLtr=%%i & call :dsKchk

If this is able to be fixed is there a way to add a function to allow me to schedule this to multiple servers. just the same as the help you gave me on the central event log backups that is working great after all of your help?

thanks in advance.
jarred
User avatar
jarmar
Posts: 19
Last visit: Tue Jun 23, 2009 11:44 am

chkdsk script for servers

Post by jarmar »

Hello. I am back for some more help. I have tried to use the chkdsk script that you have in the scriptvault but it errors everytime on line 36 char 5 which is

for /F "eol= tokens=1 delims=( " %%i in (DrvLtr.txt) do set DrvLtr=%%i & call :dsKchk

If this is able to be fixed is there a way to add a function to allow me to schedule this to multiple servers. just the same as the help you gave me on the central event log backups that is working great after all of your help?

thanks in advance.
jarred
User avatar
jarmar
Posts: 19
Last visit: Tue Jun 23, 2009 11:44 am

chkdsk script for servers

Post by jarmar »

can i also add in that it does it to all local disks? thanks
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

chkdsk script for servers

Post by jvierra »

It is far easier to just create a single BAT file for each server with teh ChkDsk commands. Remember that volumes with open files will cause you to have to do a restart to get the chkdsk to run. Each server will end up having it's own particular set of rules. Some volumes will not require a restart if they can be checked out-of-hours as teh "F" option should force all files to be closed. Most programs will allow this without complaint but you will need to test it to be sure. If you choose this path then use task scheduler to schedule a single "chkdsk" command for each volume with the necessary switches. Drive that need restarting can be scheduled at any time and then schedule the restart as a separate task after setting the chkdsk scan on boot flag.


Jeff suggestion to use PowerShell is best if you need to do anything that is more sophisticated as PoSH makes this all much easier. jvierra2007-12-03 10:43:27
User avatar
jarmar
Posts: 19
Last visit: Tue Jun 23, 2009 11:44 am

chkdsk script for servers

Post by jarmar »

Thank you for the advice. I appreciate it and will look into it.
This topic is 16 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked