I see very little information out there regarding what I'm trying to do so I took the liberty of trying it out myself, but I want some expert advice before I go and deploy this method to multiple computers.
What I'm trying to accomplish is scheduling CHKDSK to run at next boot on any given machine, this way the system volume can be checked safely and automatically.
What I have learned is that Windows 2003 forces a CHKDSK on all volumes that have the NTFS dirty bit set. What I have also learned is that you can manually set the dirty bit. Now this is where information seems to be non-existent, at least not on the first few pages of google searches.
Is it safe to purposefully set the dirty bit on all local volumes of a computer so that they have to run a CHKDSK at next boot? I have tested this on a virtual machine and it seems that it worked fine, the Event Log shows normal CHKDSK functionality output.
The script I would use would look something like:
c:\windows\system32\fsutil dirty set c:
c:\windows\system32\fsutil dirty set d:
In this example the C: and D: volumes would have their dirty bit set, then a forced shutdown and reboot would occur. Since the dirty bit was set on both volumes Windows Server 2003 performs a CHKDSK /f on both.
If you can, please advise me of the CONS of this method, all I'm seeing are PROS (Which is common when researching something new). Thanks.
P.S. I am unaware if this works on Server 2008/R2/Windows 7 environments. Everything I have researched only talks about Server 2003. (Edit: It looks like I can use "chkntfs /c [drive]" to accomplish this on a newer OS)
Bonus 100 points to the person that can show me how to make a batch file that can run a FOR loop to check for valid drives. (Most likely using 'wmic logicaldisk get name') To avoid having to create hundreds of unique script files tailored to each machine. I'm very bad at FOR loops.