Jump to content
Sign in to follow this  
Belini

Schedule scandisk for 2 units.

Recommended Posts

Belini

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
ripdad

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

Share this post


Link to post
Share on other sites
Belini

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.