Member_2_4225740
asked on
Using Regedit to force disk check at reboot
I am creating an AutoIt script that produces a menu with shortcuts to frequently used programs I run to perform routine maintenance on the Windows XP-based computers at the office where I work. One menu item will have the computer run error-checking on the hard drive when the computer reboots. The long way of doing this is double-click on My Computer, right-click on C, go to Properties, click on the Tools tab, click Check Now in the Error Check section and checking both items in the window that opens.
I know something's written to the registry for the error checking to take place when the computer reboots, but I don't know what entries these are or where they're written. I'd like my script to write these entries to the registry without having to go through the lengthy process I've described above.
I know something's written to the registry for the error checking to take place when the computer reboots, but I don't know what entries these are or where they're written. I'd like my script to write these entries to the registry without having to go through the lengthy process I've described above.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hello.
You can set dirty bit, and on reboot windows will chkdsk targeted partition.
Something like this:
RunWait("cmd /c fsutil dirty set C:")
Hope it helps.
You can set dirty bit, and on reboot windows will chkdsk targeted partition.
Something like this:
RunWait("cmd /c fsutil dirty set C:")
Hope it helps.
HKEY_LOCAL_MACHINE\SYSTEM\ CurrentCon trolSet\Co ntrol\Sess ion Manager under BootExecute key
example from vista business (for C and H drives)
autocheck autochk /r \??\H:
autocheck autochk /r \??\C:
autocheck autochk *
example from vista business (for C and H drives)
autocheck autochk /r \??\H:
autocheck autochk /r \??\C:
autocheck autochk *
lciprianionut,
I am under the impression that this has already bee mentioned.
I am under the impression that this has already bee mentioned.
ASKER
That's exactly what I was looking for. I wanted my script to run the menu items invisibly in the background without any prompts popping up, so I didn't want to use CHKDSK.
I modified my AutoIt script to write the line in the registry for the error checking to take place on the next reboot and it worked like a charm when the computer restarted. Here are the lines from my AutoIt script that made it all happen.
RegWrite("HKEY_LOCAL_MACHI NE\SYSTEM\ CurrentCon trolSet\Co ntrol\Sess ion Manager", "BootExecute", "REG_MULTI_SZ", "autocheck autochk /r \??\C:")
MsgBox (4096, "MaintMan", "Scandisk will run next time you reboot.")
Thanks everyone for their help.
I modified my AutoIt script to write the line in the registry for the error checking to take place on the next reboot and it worked like a charm when the computer restarted. Here are the lines from my AutoIt script that made it all happen.
RegWrite("HKEY_LOCAL_MACHI
MsgBox (4096, "MaintMan", "Scandisk will run next time you reboot.")
Thanks everyone for their help.
ASKER
JKR, that was exactly what I was looking for. I wanted my script to work its magic invisibly in the background without any annoying prompts, so I didn't want to use CHKDSK.
I had my script write the lines to the registry to force the disk checking to take place when the computer restarted and it worked like a charm. Here are the lines from my script that made it all happen.
RegWrite("HKEY_LOCAL_MACHI NE\SYSTEM\ CurrentCon trolSet\Co ntrol\Sess ion Manager", "BootExecute", "REG_MULTI_SZ", "autocheck autochk /r \??\C:")
MsgBox (4096, "MaintMan", "Scandisk will run next time you reboot.")
Thanks everyone for their help.
I had my script write the lines to the registry to force the disk checking to take place when the computer restarted and it worked like a charm. Here are the lines from my script that made it all happen.
RegWrite("HKEY_LOCAL_MACHI
MsgBox (4096, "MaintMan", "Scandisk will run next time you reboot.")
Thanks everyone for their help.
chkdsk.exe c:
from your script?