Sign in to follow this  
Followers 0
Belini

Schedule scandisk for 2 units.

3 posts in this topic

I want to do a scandisk on C: and D: when you start the more windows could only schedule for a unit of time.

#RequireAdmin

RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager", "BootExecute", "REG_MULTI_SZ", "autocheck autochk /r \??\c:" ); Need to do in C: and D:

Share this post


Link to post
Share on other sites



here's an example...

Func OnReboot_CheckHardDrive()
    Local $str = 'autocheck autochk /p \??\C:' & @LF
    $str &= 'autocheck autochk /p \??\D:' & @LF
    $str &= 'autocheck autochk *'
    ;
    Local $sKey = 'HKEY_LOCAL_MACHINE64\System\CurrentControlSet\Control\Session Manager'
    If @OSArch <> 'X64' Then $sKey = StringReplace($sKey, '64', '')
    RegWrite($sKey, 'BootExecute', 'REG_MULTI_SZ', $str)
    If @error Then Return SetError(-1, 0, -1)
EndFunc

Make yourself sheep and the wolves will eat you - Benjamin Franklin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0