Jump to content

Schedule scandisk for 2 units.


Recommended Posts

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:
Link to comment
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

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...