Shavlik Script Catalog: Check Disk

Version 5

    Author: Shavlik
    Category: Maintenance
    Inputs: Drive letters (or all), and analyze-only option.
    Minimum ITScripts engine version required:  8.0.0.0
    Modifies the target machine: Yes
    Name: Check Disk
    Outputs: Output from running chkdsk on target machines
    Purpose: Check fixed disk(s) for errors.  Set the 'analyzeOnly' parameter to $false to fix errors (this will succeed only if the the

    volume is not in use by another process).

    Script Version: 1.0.1.1

    Target Type: Any

     


    Technical Description:

    This script queries WMI to determine the Logical Disks on the target.  Using the input provided the script will execute the command to run check disk by using the following command:

     

    "cmd /c Chkdsk.exe $volume 1>$fileName 2>&1"

     

    Possible outputs for this script are as follows:

    "None of selected drives found ($driveLetters)"

    "Volume $volume is is marked as dirty.  Chkdsk should run on next reboot."

    "Chkdsk complete on $volume"

    "Chkdsk cannot run because the volume is in use"