euverve Posted March 17, 2009 Share Posted March 17, 2009 Note: There is commercial one of Disk drive administrator, which you can find at http://www.softstack.com/diskadmin.html I believe I could use autoit to create the same program and here it is. Information: Hide, lock and protect your local, network, Floppy and USB drives, and disable the AutoRun feature for them using this fabulously designed software. Functionality and simplicity is put in every corner of the program; intuitively understandable user interface gives you an ability to start using the program right out of the box without learning anything. All you need to do is to click on the checkboxes located within the group boxes representing individual drives. Another great feature you can use lets you disable the AutoRun feature based on drive types. This means you can disable, for instance, only all USB drives, regardless of the drive letters that can be associated with them. The program lets you protect itself from an unauthorized access by assigning a password that can be requested on each program start.. Screen shot: Source: expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUICtrlSetOnHover_UDF.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #include <String.au3> Global $hwnd, $hwnd2 Global $Input1_pass, $Input2_pass Global $Button1Apply, $Button2Password, $Button3About, $Button4Contact, $Button5Home, $Button6Software, $Button7Exit, $Button8Help Global $A_hide, $B_hide, $C_hide, $D_hide, $E_hide, $F_hide, $G_hide, $H_hide, $I_hide, $J_hide, $K_hide, $L_hide, $M_hide, $N_hide, $O_hide, $P_hide, $Q_hide, $R_hide, $S_hide, $T_hide, $U_hide, $V_hide, $W_hide, $X_hide, $Y_hide, $Z_hide Global $A_lock, $B_lock, $C_lock, $D_lock, $E_lock, $F_lock, $G_lock, $H_lock, $I_lock, $J_lock, $K_lock, $L_lock, $M_lock, $N_lock, $O_lock, $P_lock, $Q_lock, $R_lock, $S_lock, $T_lock, $U_lock, $V_lock, $W_lock, $X_lock, $Y_lock, $Z_lock Global $A_DA, $B_DA, $C_DA, $D_DA, $E_DA, $F_DA, $G_DA, $H_DA, $I_DA, $J_DA, $K_DA, $L_DA, $M_DA, $N_DA, $O_DA, $P_DA, $Q_DA, $R_DA, $S_DA, $T_DA, $U_DA, $V_DA, $W_DA, $X_DA, $Y_DA, $Z_DA Global $ExternalWriteProtect, $HDDs, $CDDVD, $USBFLOPPY, $RAMDISKS, $CheckPass, $Label2, $GuiTitle Global $icon1, $icon2, $icon3, $icon4, $icon5, $icon6, $icon7, $pass1, $Password, $pass, $key DirCreate(@ScriptDir & "\images") Sleep(50) FileInstall("disklock.ico", @ScriptDir & "\images\disklock.ico", 1) Global $X_Start, $Y_Start, $X_Final, $Y_Final, $Xtrans $pass = "HKCU\SOFTWARE\DiskDriveAdmin" $key = "Password" Opt("GuiOnEventMode", 1) Opt("MustDeclareVars", 1) $CheckPass = RegRead("HKCU\SOFTWARE\DiskDriveAdmin", "Password") $GuiTitle = "Disk Drive Administrator 1.0 | euverve - Team Pinoy Geeks" If WinExists($GuiTitle) Then MsgBox(16, "Error", "Two Instances of this tool are not allowed," & @CRLF & _ "Close first one then run it again.") Exit EndIf AutoItWinSetTitle($GuiTitle) If $CheckPass = "" Then MainForm() Else askpassword() EndIf Func MainForm() Local $Group1, $Group2, $Group3, $Group4, $Group5, $Group6, $Group7, $Group8, $Group9, $Group10, $Group11, $Group12, $Group13, $Group14 Local $Group15, $Group16, $Group17, $Group18, $Group19, $Group20, $Group21, $Group22, $Group23, $Group24, $Group25, $Group26, $Group27, $Group28, $Group29 Local $Label1, $Label3, $Label4, $Label5, $Label6, $Label7, $Label8, $Label9, $Label10, $Label11, $Label12, $Label13, $Label14 Local $Label15, $Label16, $Label17, $Label18, $Label19, $Label20, $Label21, $Label22, $Label23, $Label24, $Label25, $Label26, $Label27 Local $pic #Region ### START Koda GUI section ### Form=F:\au2it\Projects\Disk Drive Administrator\MainForm.kxf $hwnd = GUICreate($GuiTitle, 801, 605, -1, -1) GUISetIcon("C:\Documents and Settings\Thatskie\Desktop\Disk Drive Administrator\1_disklock.ico") $Group1 = GUICtrlCreateGroup("Drive:", 8, 8, 193, 57) $Label1 = GUICtrlCreateLabel("A:", 24, 24, 24, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $A_hide = GUICtrlCreateCheckbox("Hide", 56, 24, 49, 17) $A_lock = GUICtrlCreateCheckbox("Lock", 120, 24, 57, 17) $A_DA = GUICtrlCreateCheckbox("Disallow Autorun", 56, 40, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Drive:", 8, 68, 193, 57) $Label2 = GUICtrlCreateLabel("B:", 24, 84, 23, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $B_hide = GUICtrlCreateCheckbox("Hide", 56, 84, 49, 17) $B_lock = GUICtrlCreateCheckbox("Lock", 120, 84, 57, 17) $B_DA = GUICtrlCreateCheckbox("Disallow Autorun", 56, 100, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group3 = GUICtrlCreateGroup("Drive:", 8, 130, 193, 57) $Label3 = GUICtrlCreateLabel("C:", 24, 146, 24, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $C_hide = GUICtrlCreateCheckbox("Hide", 56, 146, 49, 17) $C_lock = GUICtrlCreateCheckbox("Lock", 120, 146, 57, 17) $C_DA = GUICtrlCreateCheckbox("Disallow Autorun", 56, 162, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group5 = GUICtrlCreateGroup("Drive:", 8, 192, 193, 57) $Label5 = GUICtrlCreateLabel("D:", 24, 208, 24, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $D_hide = GUICtrlCreateCheckbox("Hide", 56, 208, 49, 17) $D_lock = GUICtrlCreateCheckbox("Lock", 120, 208, 57, 17) $D_DA = GUICtrlCreateCheckbox("Disallow Autorun", 56, 224, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group6 = GUICtrlCreateGroup("Drive:", 8, 254, 193, 57) $Label6 = GUICtrlCreateLabel("E:", 24, 270, 24, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $E_hide = GUICtrlCreateCheckbox("Hide", 56, 270, 49, 17) $E_lock = GUICtrlCreateCheckbox("Lock", 120, 270, 57, 17) $E_DA = GUICtrlCreateCheckbox("Disallow Autorun", 56, 286, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group7 = GUICtrlCreateGroup("Drive:", 8, 312, 193, 57) $Label7 = GUICtrlCreateLabel("F:", 24, 328, 23, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $F_hide = GUICtrlCreateCheckbox("Hide", 56, 328, 49, 17) $F_lock = GUICtrlCreateCheckbox("Lock", 120, 328, 57, 17) $F_DA = GUICtrlCreateCheckbox("Disallow Autorun", 56, 344, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group8 = GUICtrlCreateGroup("Drive:", 8, 374, 193, 57) $Label8 = GUICtrlCreateLabel("G:", 24, 390, 25, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $G_hide = GUICtrlCreateCheckbox("Hide", 56, 390, 49, 17) $G_lock = GUICtrlCreateCheckbox("Lock", 120, 390, 57, 17) $G_DA = GUICtrlCreateCheckbox("Disallow Autorun", 56, 406, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group9 = GUICtrlCreateGroup("Drive:", 8, 432, 193, 57) $Label9 = GUICtrlCreateLabel("H:", 24, 448, 25, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $H_hide = GUICtrlCreateCheckbox("Hide", 56, 448, 49, 17) $H_lock = GUICtrlCreateCheckbox("Lock", 120, 448, 57, 17) $H_DA = GUICtrlCreateCheckbox("Disallow Autorun", 56, 464, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group10 = GUICtrlCreateGroup("External Drive Write Protection", 8, 552, 593, 41) $icon1 = GUICtrlCreateIcon("C:\WINDOWS\system32\shell32.dll", -48, 24, 568, 16, 16, BitOR($SS_NOTIFY, $WS_GROUP)) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group11 = GUICtrlCreateGroup("Drive:", 8, 494, 193, 57) $Label10 = GUICtrlCreateLabel("I:", 24, 510, 15, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $I_hide = GUICtrlCreateCheckbox("Hide", 56, 510, 49, 17) $I_lock = GUICtrlCreateCheckbox("Lock", 120, 510, 57, 17) $I_DA = GUICtrlCreateCheckbox("Disallow Autorun", 56, 526, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group12 = GUICtrlCreateGroup("Drive:", 208, 8, 193, 57) $Label11 = GUICtrlCreateLabel("J:", 224, 24, 20, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $J_hide = GUICtrlCreateCheckbox("Hide", 256, 24, 49, 17) $J_lock = GUICtrlCreateCheckbox("Lock", 320, 24, 57, 17) $J_DA = GUICtrlCreateCheckbox("Disallow Autorun", 256, 40, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group13 = GUICtrlCreateGroup("Drive:", 208, 68, 193, 57) $Label12 = GUICtrlCreateLabel("K:", 224, 84, 23, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $K_hide = GUICtrlCreateCheckbox("Hide", 256, 84, 49, 17) $K_lock = GUICtrlCreateCheckbox("Lock", 320, 84, 57, 17) $K_DA = GUICtrlCreateCheckbox("Disallow Autorun", 256, 100, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group14 = GUICtrlCreateGroup("Drive:", 208, 130, 193, 57) $Label13 = GUICtrlCreateLabel("L:", 224, 146, 21, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $L_hide = GUICtrlCreateCheckbox("Hide", 256, 146, 49, 17) $L_lock = GUICtrlCreateCheckbox("Lock", 320, 146, 57, 17) $L_DA = GUICtrlCreateCheckbox("Disallow Autorun", 256, 162, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group15 = GUICtrlCreateGroup("Drive:", 208, 192, 193, 57) $Label14 = GUICtrlCreateLabel("M:", 224, 208, 27, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $M_hide = GUICtrlCreateCheckbox("Hide", 256, 208, 49, 17) $M_lock = GUICtrlCreateCheckbox("Lock", 320, 208, 57, 17) $M_DA = GUICtrlCreateCheckbox("Disallow Autorun", 256, 224, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group16 = GUICtrlCreateGroup("Drive:", 208, 254, 193, 57) $Label15 = GUICtrlCreateLabel("N:", 224, 270, 25, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $N_hide = GUICtrlCreateCheckbox("Hide", 256, 270, 49, 17) $N_lock = GUICtrlCreateCheckbox("Lock", 320, 270, 57, 17) $N_DA = GUICtrlCreateCheckbox("Disallow Autorun", 256, 286, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group17 = GUICtrlCreateGroup("Drive:", 208, 312, 193, 57) $Label16 = GUICtrlCreateLabel("O:", 224, 328, 26, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $O_hide = GUICtrlCreateCheckbox("Hide", 256, 328, 49, 17) $O_lock = GUICtrlCreateCheckbox("Lock", 320, 328, 57, 17) $O_DA = GUICtrlCreateCheckbox("Disallow Autorun", 256, 344, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group18 = GUICtrlCreateGroup("Drive:", 208, 374, 193, 57) $Label17 = GUICtrlCreateLabel("P:", 224, 390, 23, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $P_hide = GUICtrlCreateCheckbox("Hide", 256, 390, 49, 17) $P_lock = GUICtrlCreateCheckbox("Lock", 320, 390, 57, 17) $P_DA = GUICtrlCreateCheckbox("Disallow Autorun", 256, 406, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group19 = GUICtrlCreateGroup("Drive:", 208, 432, 193, 57) $Label18 = GUICtrlCreateLabel("Q:", 224, 448, 26, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Q_hide = GUICtrlCreateCheckbox("Hide", 256, 448, 49, 17) $Q_lock = GUICtrlCreateCheckbox("Lock", 320, 448, 57, 17) $Q_DA = GUICtrlCreateCheckbox("Disallow Autorun", 256, 464, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group20 = GUICtrlCreateGroup("Drive:", 208, 494, 193, 57) $Label19 = GUICtrlCreateLabel("R:", 224, 510, 24, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $R_hide = GUICtrlCreateCheckbox("Hide", 256, 510, 49, 17) $R_lock = GUICtrlCreateCheckbox("Lock", 320, 510, 57, 17) $R_DA = GUICtrlCreateCheckbox("Disallow Autorun", 256, 526, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group21 = GUICtrlCreateGroup("Drive:", 408, 8, 193, 57) $Label20 = GUICtrlCreateLabel("S:", 424, 24, 23, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $S_hide = GUICtrlCreateCheckbox("Hide", 456, 24, 49, 17) $S_lock = GUICtrlCreateCheckbox("Lock", 520, 24, 57, 17) $S_DA = GUICtrlCreateCheckbox("Disallow Autorun", 456, 40, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group22 = GUICtrlCreateGroup("Drive:", 408, 68, 193, 57) $Label21 = GUICtrlCreateLabel("T:", 424, 84, 23, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $T_hide = GUICtrlCreateCheckbox("Hide", 456, 84, 49, 17) $T_lock = GUICtrlCreateCheckbox("Lock", 520, 84, 57, 17) $T_DA = GUICtrlCreateCheckbox("Disallow Autorun", 456, 100, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group23 = GUICtrlCreateGroup("Drive:", 408, 130, 193, 57) $Label22 = GUICtrlCreateLabel("U:", 424, 146, 24, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $U_hide = GUICtrlCreateCheckbox("Hide", 456, 146, 49, 17) $U_lock = GUICtrlCreateCheckbox("Lock", 520, 146, 57, 17) $U_DA = GUICtrlCreateCheckbox("Disallow Autorun", 456, 162, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group24 = GUICtrlCreateGroup("Drive:", 408, 192, 193, 57) $Label23 = GUICtrlCreateLabel("V:", 424, 208, 24, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $V_hide = GUICtrlCreateCheckbox("Hide", 456, 208, 49, 17) $V_lock = GUICtrlCreateCheckbox("Lock", 520, 208, 57, 17) $V_DA = GUICtrlCreateCheckbox("Disallow Autorun", 456, 224, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group25 = GUICtrlCreateGroup("Drive:", 408, 254, 193, 57) $Label24 = GUICtrlCreateLabel("W:", 424, 270, 29, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $W_hide = GUICtrlCreateCheckbox("Hide", 456, 270, 49, 17) $W_lock = GUICtrlCreateCheckbox("Lock", 520, 270, 57, 17) $W_DA = GUICtrlCreateCheckbox("Disallow Autorun", 456, 286, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group26 = GUICtrlCreateGroup("Drive:", 408, 312, 193, 57) $Label25 = GUICtrlCreateLabel("X:", 424, 328, 25, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $X_hide = GUICtrlCreateCheckbox("Hide", 456, 328, 49, 17) $X_lock = GUICtrlCreateCheckbox("Lock", 520, 328, 57, 17) $X_DA = GUICtrlCreateCheckbox("Disallow Autorun", 456, 344, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group27 = GUICtrlCreateGroup("Drive:", 408, 374, 193, 57) $Label26 = GUICtrlCreateLabel("Y:", 424, 390, 23, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Y_hide = GUICtrlCreateCheckbox("Hide", 456, 390, 49, 17) $Y_lock = GUICtrlCreateCheckbox("Lock", 520, 390, 57, 17) $Y_DA = GUICtrlCreateCheckbox("Disallow Autorun", 456, 406, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group28 = GUICtrlCreateGroup("Drive:", 408, 432, 193, 57) $Label27 = GUICtrlCreateLabel("Z:", 424, 448, 23, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Z_hide = GUICtrlCreateCheckbox("Hide", 456, 448, 49, 17) $Z_lock = GUICtrlCreateCheckbox("Lock", 520, 448, 57, 17) $Z_DA = GUICtrlCreateCheckbox("Disallow Autorun", 456, 464, 121, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $ExternalWriteProtect = GUICtrlCreateCheckbox("Write-protect external removable drives such as USB flash drives, mass storagge and external hard drives.", 48, 568, 529, 17) $Button1Apply = GUICtrlCreateButton("Apply Restrictions", 608, 40, 185, 57, $BS_DEFPUSHBUTTON) GUICtrlSetState(-1, $GUI_DISABLE) $Button2Password = GUICtrlCreateButton("Apply Password", 608, 104, 185, 57, $BS_DEFPUSHBUTTON) $Button3About = GUICtrlCreateButton("About this Program", 608, 232, 185, 57, $BS_DEFPUSHBUTTON) $Button4Contact = GUICtrlCreateButton("Contact Author", 608, 168, 185, 57, $BS_DEFPUSHBUTTON) $Button5Home = GUICtrlCreateButton("My Homepage", 608, 296, 185, 57, $BS_DEFPUSHBUTTON) $Button6Software = GUICtrlCreateButton("Program Help", 608, 360, 185, 57, $BS_DEFPUSHBUTTON) $Button7Exit = GUICtrlCreateButton("Exit Program", 608, 488, 185, 57, $BS_DEFPUSHBUTTON) $Button8Help = GUICtrlCreateButton("Program Purpose", 608, 424, 185, 57, $BS_DEFPUSHBUTTON) $Group29 = GUICtrlCreateGroup("Disallow Autorun for Drive Types", 408, 494, 193, 57) $HDDs = GUICtrlCreateCheckbox("HDDs", 424, 510, 65, 17) $CDDVD = GUICtrlCreateCheckbox("CD\DVD", 424, 526, 65, 17) $USBFLOPPY = GUICtrlCreateCheckbox("USB\Floppy", 504, 510, 81, 17) $RAMDISKS = GUICtrlCreateCheckbox("RAM Disks", 504, 526, 73, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group4 = GUICtrlCreateGroup("Coded By:", 608, 552, 185, 41) $Label1 = GUICtrlCreateLabel("-:| euverve | Pinoy Geeks |:- ", 616, 568, 172, 17, BitOR($SS_CENTER, $SS_SUNKEN)) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label2 = GUICtrlCreateLabel("Launching GUI ", 656, 16, 132, 17, BitOR($SS_CENTER, $SS_SUNKEN)) $Label3 = GUICtrlCreateLabel("Status:", 616, 18, 37, 17) GUISetState(@SW_SHOW) GUICtrlSetData($Label2, "Ready") #EndRegion ### END Koda GUI section ### GUISetOnEvent($GUI_EVENT_CLOSE, "exitprogram") GUICtrlSetOnEvent($Button1Apply, "confirmapply") GUICtrlSetOnEvent($Button2Password, "ApplyPassword") GUICtrlSetOnEvent($Button3About, "about") GUICtrlSetOnEvent($Button4Contact, "mailto") GUICtrlSetOnEvent($Button5Home, "website") GUICtrlSetOnEvent($Button6Software, "proghelp") GUICtrlSetOnEvent($Button7Exit, "exitprogram") GUICtrlSetOnEvent($Button8Help, "progPurpose") checkstate() AdlibEnable("checkstate", "1000") EndFunc ;==>MainForm While 1 Local $nMsg $nMsg = GUIGetMsg() WEnd Func website() GUICtrlSetData($Label2, "Launching Browser...") ShellExecute("www.pinoygeeks.co.cc") GUICtrlSetData($Label2, "Ready") EndFunc ;==>website Func mailto() GUICtrlSetData($Label2, "Launching Email Client...") ShellExecute("mailto: euverve@gmail.com") GUICtrlSetData($Label2, "Ready") EndFunc ;==>mailto Func exitprogram() Local $XYZ $XYZ = GUICtrlGetState($Button1Apply) = "80" if $XYZ = TRUE then While 1 If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(35, "Confirm", "Apply changes?") Select Case $iMsgBoxAnswer = 6 ;Yes ApplyRestrictionsatExit() Case $iMsgBoxAnswer = 7 ;No Exit Case $iMsgBoxAnswer = 2 ;Cancel ExitLoop EndSelect ExitLoop WEnd Else Exit EndIf EndFunc ;==>exitprogram Func close() GUIDelete($hwnd2) GUICtrlSetState($hwnd, @SW_SHOW) EndFunc ;==>close Func confirmapply() While 1 If MsgBox(36, "Confirm", "Apply changes?") = 7 Then ExitLoop Else ApplyRestrictions() ExitLoop EndIf ExitLoop WEnd EndFunc ;==>confirmapply Func ApplyRestrictions() While 1 GUICtrlSetData($Label2, "Applying Restrictions...") Local $DisableDriveType, $HideDrives, $PreventAcessToDrives, $DisableDriveAutorun, $RegKeyHKCU, $RegKeyHKLM Local $NoDrives, $NoViewOnDrive, $NoDriveAutoRun, $NoDriveTypeAutoRun, $RegType, $DisableDriveType Local $HideDrives, $PreventAcessToDrives, $DisableDriveAutorun, $RegKeyHKCU, $RegKeyHKLM, $NoDrives Local $NoViewOnDrive, $NoDriveAutoRun Dim $A_, $B_, $C_, $D_, $E_, $F_, $G_, $H_, $I_, $J_, $K_, $L_, $M_, $N_, $O_, $P_, $Q_, $R_, $S_, $T_, $U_, $V_, $W_, $X_, $Y_, $Z_ Dim $A__, $B__, $C__, $D__, $E__, $F__, $G__, $H__, $I__, $J__, $K__, $L__, $M__, $N__, $O__, $P__, $Q__, $R__, $S__, $T__, $U__, $V__, $W__, $X__, $Y__, $Z__ Dim $A___, $B___, $C___, $D___, $E___, $F___, $G___, $H___, $I___, $J___, $K___, $L___, $M___, $N___, $O___, $P___, $Q___, $R___, $S___, $T___, $U___, $V___, $W___, $X___, $Y___, $Z___ Dim $1_, $2_, $3_, $4_ If GUICtrlRead($HDDs) = $Gui_Checked Then $1_ = "8" Else $1_ = "0" EndIf If GUICtrlRead($CDDVD) = $Gui_Checked Then $2_ = "32" Else $2_ = "0" EndIf If GUICtrlRead($USBFLOPPY) = $Gui_Checked Then $3_ = "4" Else $3_ = "0" EndIf If GUICtrlRead($RAMDISKS) = $Gui_Checked Then $4_ = "64" Else $4_ = "0" EndIf ; ========================================= If GUICtrlRead($A_hide) = $Gui_Checked Then $A_ = "1" Else $A_ = "0" EndIf If GUICtrlRead($B_hide) = $Gui_Checked Then $B_ = "2" Else $B_ = "0" EndIf If GUICtrlRead($C_hide) = $Gui_Checked Then $C_ = "4" Else $C_ = "0" EndIf If GUICtrlRead($D_hide) = $Gui_Checked Then $D_ = "8" Else $D_ = "0" EndIf If GUICtrlRead($E_hide) = $Gui_Checked Then $E_ = "16" Else $E_ = "0" EndIf If GUICtrlRead($F_hide) = $Gui_Checked Then $F_ = "32" Else $F_ = "0" EndIf If GUICtrlRead($G_hide) = $Gui_Checked Then $G_ = "64" Else $G_ = "0" EndIf If GUICtrlRead($H_hide) = $Gui_Checked Then $H_ = "128" Else $H_ = "0" EndIf If GUICtrlRead($I_hide) = $Gui_Checked Then $I_ = "256" Else $I_ = "0" EndIf If GUICtrlRead($J_hide) = $Gui_Checked Then $J_ = "512" Else $J_ = "0" EndIf If GUICtrlRead($K_hide) = $Gui_Checked Then $K_ = "1024" Else $K_ = "0" EndIf If GUICtrlRead($L_hide) = $Gui_Checked Then $L_ = "2048" Else $L_ = "0" EndIf If GUICtrlRead($M_hide) = $Gui_Checked Then $M_ = "4096" Else $M_ = "0" EndIf If GUICtrlRead($N_hide) = $Gui_Checked Then $N_ = "8192" Else $N_ = "0" EndIf If GUICtrlRead($O_hide) = $Gui_Checked Then $O_ = "16384" Else $O_ = "0" EndIf If GUICtrlRead($P_hide) = $Gui_Checked Then $P_ = "32768" Else $P_ = "0" EndIf If GUICtrlRead($Q_hide) = $Gui_Checked Then $Q_ = "65536" Else $Q_ = "0" EndIf If GUICtrlRead($R_hide) = $Gui_Checked Then $R_ = "131072" Else $R_ = "0" EndIf If GUICtrlRead($S_hide) = $Gui_Checked Then $S_ = "262144" Else $S_ = "0" EndIf If GUICtrlRead($T_hide) = $Gui_Checked Then $T_ = "524288" Else $T_ = "0" EndIf If GUICtrlRead($U_hide) = $Gui_Checked Then $U_ = "1048576" Else $U_ = "0" EndIf If GUICtrlRead($V_hide) = $Gui_Checked Then $V_ = "2097152" Else $V_ = "0" EndIf If GUICtrlRead($W_hide) = $Gui_Checked Then $W_ = "4194304" Else $W_ = "0" EndIf If GUICtrlRead($X_hide) = $Gui_Checked Then $X_ = "8388608" Else $X_ = "0" EndIf If GUICtrlRead($Y_hide) = $Gui_Checked Then $Y_ = "16777216" Else $Y_ = "0" EndIf If GUICtrlRead($Z_hide) = $Gui_Checked Then $Z_ = "33554432" Else $Z_ = "0" EndIf ; ========================== If GUICtrlRead($A_lock) = $Gui_Checked Then $A__ = "1" Else $A__ = "0" EndIf If GUICtrlRead($B_lock) = $Gui_Checked Then $B__ = "2" Else $B__ = "0" EndIf If GUICtrlRead($C_lock) = $Gui_Checked Then $C__ = "4" Else $C__ = "0" EndIf If GUICtrlRead($D_lock) = $Gui_Checked Then $D__ = "8" Else $D__ = "0" EndIf If GUICtrlRead($E_lock) = $Gui_Checked Then $E__ = "16" Else $E__ = "0" EndIf If GUICtrlRead($F_lock) = $Gui_Checked Then $F__ = "32" Else $F__ = "0" EndIf If GUICtrlRead($G_lock) = $Gui_Checked Then $G__ = "64" Else $G__ = "0" EndIf If GUICtrlRead($H_lock) = $Gui_Checked Then $H__ = "128" Else $H__ = "0" EndIf If GUICtrlRead($I_lock) = $Gui_Checked Then $I__ = "256" Else $I__ = "0" EndIf If GUICtrlRead($J_lock) = $Gui_Checked Then $J__ = "512" Else $J__ = "0" EndIf If GUICtrlRead($K_lock) = $Gui_Checked Then $K__ = "1024" Else $K__ = "0" EndIf If GUICtrlRead($L_lock) = $Gui_Checked Then $L__ = "2048" Else $L__ = "0" EndIf If GUICtrlRead($M_lock) = $Gui_Checked Then $M__ = "4096" Else $M__ = "0" EndIf If GUICtrlRead($N_lock) = $Gui_Checked Then $N__ = "8192" Else $N__ = "0" EndIf If GUICtrlRead($O_lock) = $Gui_Checked Then $O__ = "16384" Else $O__ = "0" EndIf If GUICtrlRead($P_lock) = $Gui_Checked Then $P__ = "32768" Else $P__ = "0" EndIf If GUICtrlRead($Q_lock) = $Gui_Checked Then $Q__ = "65536" Else $Q__ = "0" EndIf If GUICtrlRead($R_lock) = $Gui_Checked Then $R__ = "131072" Else $R__ = "0" EndIf If GUICtrlRead($S_lock) = $Gui_Checked Then $S__ = "262144" Else $S__ = "0" EndIf If GUICtrlRead($T_lock) = $Gui_Checked Then $T__ = "524288" Else $T__ = "0" EndIf If GUICtrlRead($U_lock) = $Gui_Checked Then $U__ = "1048576" Else $U__ = "0" EndIf If GUICtrlRead($V_lock) = $Gui_Checked Then $V__ = "2097152" Else $V__ = "0" EndIf If GUICtrlRead($W_lock) = $Gui_Checked Then $W__ = "4194304" Else $W__ = "0" EndIf If GUICtrlRead($X_lock) = $Gui_Checked Then $X__ = "8388608" Else $X__ = "0" EndIf If GUICtrlRead($Y_lock) = $Gui_Checked Then $Y__ = "16777216" Else $Y__ = "0" EndIf If GUICtrlRead($Z_lock) = $Gui_Checked Then $Z__ = "33554432" Else $Z__ = "0" EndIf ; ========================================== If GUICtrlRead($A_DA) = $Gui_Checked Then $A___ = "1" Else $A___ = "0" EndIf If GUICtrlRead($B_DA) = $Gui_Checked Then $B___ = "2" Else $B___ = "0" EndIf If GUICtrlRead($C_DA) = $Gui_Checked Then $C___ = "4" Else $C___ = "0" EndIf If GUICtrlRead($D_DA) = $Gui_Checked Then $D___ = "8" Else $D___ = "0" EndIf If GUICtrlRead($E_DA) = $Gui_Checked Then $E___ = "16" Else $E___ = "0" EndIf If GUICtrlRead($F_DA) = $Gui_Checked Then $F___ = "32" Else $F___ = "0" EndIf If GUICtrlRead($G_DA) = $Gui_Checked Then $G___ = "64" Else $G___ = "0" EndIf If GUICtrlRead($H_DA) = $Gui_Checked Then $H___ = "128" Else $H___ = "0" EndIf If GUICtrlRead($I_DA) = $Gui_Checked Then $I___ = "256" Else $I___ = "0" EndIf If GUICtrlRead($J_DA) = $Gui_Checked Then $J___ = "512" Else $J___ = "0" EndIf If GUICtrlRead($K_DA) = $Gui_Checked Then $K___ = "1024" Else $K___ = "0" EndIf If GUICtrlRead($L_DA) = $Gui_Checked Then $L___ = "2048" Else $L___ = "0" EndIf If GUICtrlRead($M_DA) = $Gui_Checked Then $M___ = "4096" Else $M___ = "0" EndIf If GUICtrlRead($N_DA) = $Gui_Checked Then $N___ = "8192" Else $N___ = "0" EndIf If GUICtrlRead($O_DA) = $Gui_Checked Then $O___ = "16384" Else $O___ = "0" EndIf If GUICtrlRead($P_DA) = $Gui_Checked Then $P___ = "32768" Else $P___ = "0" EndIf If GUICtrlRead($Q_DA) = $Gui_Checked Then $Q___ = "65536" Else $Q___ = "0" EndIf If GUICtrlRead($R_DA) = $Gui_Checked Then $R___ = "131072" Else $R___ = "0" EndIf If GUICtrlRead($S_DA) = $Gui_Checked Then $S___ = "262144" Else $S___ = "0" EndIf If GUICtrlRead($T_DA) = $Gui_Checked Then $T___ = "524288" Else $T___ = "0" EndIf If GUICtrlRead($U_DA) = $Gui_Checked Then $U___ = "1048576" Else $U___ = "0" EndIf If GUICtrlRead($V_DA) = $Gui_Checked Then $V___ = "2097152" Else $V___ = "0" EndIf If GUICtrlRead($W_DA) = $Gui_Checked Then $W___ = "4194304" Else $W___ = "0" EndIf If GUICtrlRead($X_DA) = $Gui_Checked Then $X___ = "8388608" Else $X___ = "0" EndIf If GUICtrlRead($Y_DA) = $Gui_Checked Then $Y___ = "16777216" Else $Y___ = "0" EndIf If GUICtrlRead($Z_DA) = $Gui_Checked Then $Z___ = "33554432" Else $Z___ = "0" EndIf ;======================================== $DisableDriveType = $1_ + $2_ + $3_ + $4_ $HideDrives = $A_ + $B_ + $C_ + $D_ + $E_ + $F_ + $G_ + $H_ + $I_ + $J_ + $K_ + $L_ + $M_ + $N_ + $O_ + $P_ + $Q_ + $R_ + $S_ + $T_ + $U_ + $V_ + $W_ + $X_ + $Y_ + $Z_ $PreventAcessToDrives = $A__ + $B__ + $C__ + $D__ + $E__ + $F__ + $G__ + $H__ + $I__ + $J__ + $K__ + $L__ + $M__ + $N__ + $O__ + $P__ + $Q__ + $R__ + $S__ + $T__ + $U__ + $V__ + $W__ + $X__ + $Y__ + $Z__ $DisableDriveAutorun = $A___ + $B___ + $C___ + $D___ + $E___ + $F___ + $G___ + $H___ + $I___ + $J___ + $K___ + $L___ + $M___ + $N___ + $O___ + $P___ + $Q___ + $R___ + $S___ + $T___ + $U___ + $V___ + $W___ + $X___ + $Y___ + $Z___ $RegKeyHKCU = "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer" $RegKeyHKLM = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer" $NoDrives = "NoDrives" ;Hide Drives $NoViewOnDrive = "NoViewOnDrive" ;Prevent Access to Drives $NoDriveAutoRun = "NoDriveAutoRun" ;Disable autorun on selected drives $NoDriveTypeAutoRun = "NoDriveTypeAutoRun" ;Disable autorun on drive type $RegType = "REG_DWORD" RegWrite($RegKeyHKCU, $NoDrives, $RegType, $HideDrives) RegWrite($RegKeyHKLM, $NoDrives, $RegType, $HideDrives) RegWrite($RegKeyHKCU, $NoViewOnDrive, $RegType, $PreventAcessToDrives) RegWrite($RegKeyHKLM, $NoViewOnDrive, $RegType, $PreventAcessToDrives) RegWrite($RegKeyHKCU, $NoDriveAutoRun, $RegType, $DisableDriveAutorun) RegWrite($RegKeyHKLM, $NoDriveAutoRun, $RegType, $DisableDriveAutorun) RegWrite($RegKeyHKCU, $NoDriveTypeAutoRun, $RegType, $DisableDriveType) RegWrite($RegKeyHKLM, $NoDriveTypeAutoRun, $RegType, $DisableDriveType) If GUICtrlRead($ExternalWriteProtect) = $Gui_Checked Then RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "REG_DWORD", "1") RegWrite("HKCU\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "REG_DWORD", "1") Else RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "REG_DWORD", "0") RegWrite("HKCU\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "REG_DWORD", "0") EndIf GUICtrlSetData($Label2, "Ready") ;Call activate changes activatechanges() ExitLoop WEnd EndFunc ;==>ApplyRestrictions Func ApplyRestrictionsatExit() GUICtrlSetData($Label2, "Applying Restrictions") Local $DisableDriveType, $HideDrives, $PreventAcessToDrives, $DisableDriveAutorun, $RegKeyHKCU, $RegKeyHKLM Local $NoDrives, $NoViewOnDrive, $NoDriveAutoRun, $NoDriveTypeAutoRun, $RegType, $DisableDriveType Local $HideDrives, $PreventAcessToDrives, $DisableDriveAutorun, $RegKeyHKCU, $RegKeyHKLM, $NoDrives Local $NoViewOnDrive, $NoDriveAutoRun Dim $A_, $B_, $C_, $D_, $E_, $F_, $G_, $H_, $I_, $J_, $K_, $L_, $M_, $N_, $O_, $P_, $Q_, $R_, $S_, $T_, $U_, $V_, $W_, $X_, $Y_, $Z_ Dim $A__, $B__, $C__, $D__, $E__, $F__, $G__, $H__, $I__, $J__, $K__, $L__, $M__, $N__, $O__, $P__, $Q__, $R__, $S__, $T__, $U__, $V__, $W__, $X__, $Y__, $Z__ Dim $A___, $B___, $C___, $D___, $E___, $F___, $G___, $H___, $I___, $J___, $K___, $L___, $M___, $N___, $O___, $P___, $Q___, $R___, $S___, $T___, $U___, $V___, $W___, $X___, $Y___, $Z___ Dim $1_, $2_, $3_, $4_ If GUICtrlRead($HDDs) = $Gui_Checked Then $1_ = "8" Else $1_ = "0" EndIf If GUICtrlRead($CDDVD) = $Gui_Checked Then $2_ = "32" Else $2_ = "0" EndIf If GUICtrlRead($USBFLOPPY) = $Gui_Checked Then $3_ = "4" Else $3_ = "0" EndIf If GUICtrlRead($RAMDISKS) = $Gui_Checked Then $4_ = "64" Else $4_ = "0" EndIf ; ========================================= If GUICtrlRead($A_hide) = $Gui_Checked Then $A_ = "1" Else $A_ = "0" EndIf If GUICtrlRead($B_hide) = $Gui_Checked Then $B_ = "2" Else $B_ = "0" EndIf If GUICtrlRead($C_hide) = $Gui_Checked Then $C_ = "4" Else $C_ = "0" EndIf If GUICtrlRead($D_hide) = $Gui_Checked Then $D_ = "8" Else $D_ = "0" EndIf If GUICtrlRead($E_hide) = $Gui_Checked Then $E_ = "16" Else $E_ = "0" EndIf If GUICtrlRead($F_hide) = $Gui_Checked Then $F_ = "32" Else $F_ = "0" EndIf If GUICtrlRead($G_hide) = $Gui_Checked Then $G_ = "64" Else $G_ = "0" EndIf If GUICtrlRead($H_hide) = $Gui_Checked Then $H_ = "128" Else $H_ = "0" EndIf If GUICtrlRead($I_hide) = $Gui_Checked Then $I_ = "256" Else $I_ = "0" EndIf If GUICtrlRead($J_hide) = $Gui_Checked Then $J_ = "512" Else $J_ = "0" EndIf If GUICtrlRead($K_hide) = $Gui_Checked Then $K_ = "1024" Else $K_ = "0" EndIf If GUICtrlRead($L_hide) = $Gui_Checked Then $L_ = "2048" Else $L_ = "0" EndIf If GUICtrlRead($M_hide) = $Gui_Checked Then $M_ = "4096" Else $M_ = "0" EndIf If GUICtrlRead($N_hide) = $Gui_Checked Then $N_ = "8192" Else $N_ = "0" EndIf If GUICtrlRead($O_hide) = $Gui_Checked Then $O_ = "16384" Else $O_ = "0" EndIf If GUICtrlRead($P_hide) = $Gui_Checked Then $P_ = "32768" Else $P_ = "0" EndIf If GUICtrlRead($Q_hide) = $Gui_Checked Then $Q_ = "65536" Else $Q_ = "0" EndIf If GUICtrlRead($R_hide) = $Gui_Checked Then $R_ = "131072" Else $R_ = "0" EndIf If GUICtrlRead($S_hide) = $Gui_Checked Then $S_ = "262144" Else $S_ = "0" EndIf If GUICtrlRead($T_hide) = $Gui_Checked Then $T_ = "524288" Else $T_ = "0" EndIf If GUICtrlRead($U_hide) = $Gui_Checked Then $U_ = "1048576" Else $U_ = "0" EndIf If GUICtrlRead($V_hide) = $Gui_Checked Then $V_ = "2097152" Else $V_ = "0" EndIf If GUICtrlRead($W_hide) = $Gui_Checked Then $W_ = "4194304" Else $W_ = "0" EndIf If GUICtrlRead($X_hide) = $Gui_Checked Then $X_ = "8388608" Else $X_ = "0" EndIf If GUICtrlRead($Y_hide) = $Gui_Checked Then $Y_ = "16777216" Else $Y_ = "0" EndIf If GUICtrlRead($Z_hide) = $Gui_Checked Then $Z_ = "33554432" Else $Z_ = "0" EndIf ; ========================== If GUICtrlRead($A_lock) = $Gui_Checked Then $A__ = "1" Else $A__ = "0" EndIf If GUICtrlRead($B_lock) = $Gui_Checked Then $B__ = "2" Else $B__ = "0" EndIf If GUICtrlRead($C_lock) = $Gui_Checked Then $C__ = "4" Else $C__ = "0" EndIf If GUICtrlRead($D_lock) = $Gui_Checked Then $D__ = "8" Else $D__ = "0" EndIf If GUICtrlRead($E_lock) = $Gui_Checked Then $E__ = "16" Else $E__ = "0" EndIf If GUICtrlRead($F_lock) = $Gui_Checked Then $F__ = "32" Else $F__ = "0" EndIf If GUICtrlRead($G_lock) = $Gui_Checked Then $G__ = "64" Else $G__ = "0" EndIf If GUICtrlRead($H_lock) = $Gui_Checked Then $H__ = "128" Else $H__ = "0" EndIf If GUICtrlRead($I_lock) = $Gui_Checked Then $I__ = "256" Else $I__ = "0" EndIf If GUICtrlRead($J_lock) = $Gui_Checked Then $J__ = "512" Else $J__ = "0" EndIf If GUICtrlRead($K_lock) = $Gui_Checked Then $K__ = "1024" Else $K__ = "0" EndIf If GUICtrlRead($L_lock) = $Gui_Checked Then $L__ = "2048" Else $L__ = "0" EndIf If GUICtrlRead($M_lock) = $Gui_Checked Then $M__ = "4096" Else $M__ = "0" EndIf If GUICtrlRead($N_lock) = $Gui_Checked Then $N__ = "8192" Else $N__ = "0" EndIf If GUICtrlRead($O_lock) = $Gui_Checked Then $O__ = "16384" Else $O__ = "0" EndIf If GUICtrlRead($P_lock) = $Gui_Checked Then $P__ = "32768" Else $P__ = "0" EndIf If GUICtrlRead($Q_lock) = $Gui_Checked Then $Q__ = "65536" Else $Q__ = "0" EndIf If GUICtrlRead($R_lock) = $Gui_Checked Then $R__ = "131072" Else $R__ = "0" EndIf If GUICtrlRead($S_lock) = $Gui_Checked Then $S__ = "262144" Else $S__ = "0" EndIf If GUICtrlRead($T_lock) = $Gui_Checked Then $T__ = "524288" Else $T__ = "0" EndIf If GUICtrlRead($U_lock) = $Gui_Checked Then $U__ = "1048576" Else $U__ = "0" EndIf If GUICtrlRead($V_lock) = $Gui_Checked Then $V__ = "2097152" Else $V__ = "0" EndIf If GUICtrlRead($W_lock) = $Gui_Checked Then $W__ = "4194304" Else $W__ = "0" EndIf If GUICtrlRead($X_lock) = $Gui_Checked Then $X__ = "8388608" Else $X__ = "0" EndIf If GUICtrlRead($Y_lock) = $Gui_Checked Then $Y__ = "16777216" Else $Y__ = "0" EndIf If GUICtrlRead($Z_lock) = $Gui_Checked Then $Z__ = "33554432" Else $Z__ = "0" EndIf ; ========================================== If GUICtrlRead($A_DA) = $Gui_Checked Then $A___ = "1" Else $A___ = "0" EndIf If GUICtrlRead($B_DA) = $Gui_Checked Then $B___ = "2" Else $B___ = "0" EndIf If GUICtrlRead($C_DA) = $Gui_Checked Then $C___ = "4" Else $C___ = "0" EndIf If GUICtrlRead($D_DA) = $Gui_Checked Then $D___ = "8" Else $D___ = "0" EndIf If GUICtrlRead($E_DA) = $Gui_Checked Then $E___ = "16" Else $E___ = "0" EndIf If GUICtrlRead($F_DA) = $Gui_Checked Then $F___ = "32" Else $F___ = "0" EndIf If GUICtrlRead($G_DA) = $Gui_Checked Then $G___ = "64" Else $G___ = "0" EndIf If GUICtrlRead($H_DA) = $Gui_Checked Then $H___ = "128" Else $H___ = "0" EndIf If GUICtrlRead($I_DA) = $Gui_Checked Then $I___ = "256" Else $I___ = "0" EndIf If GUICtrlRead($J_DA) = $Gui_Checked Then $J___ = "512" Else $J___ = "0" EndIf If GUICtrlRead($K_DA) = $Gui_Checked Then $K___ = "1024" Else $K___ = "0" EndIf If GUICtrlRead($L_DA) = $Gui_Checked Then $L___ = "2048" Else $L___ = "0" EndIf If GUICtrlRead($M_DA) = $Gui_Checked Then $M___ = "4096" Else $M___ = "0" EndIf If GUICtrlRead($N_DA) = $Gui_Checked Then $N___ = "8192" Else $N___ = "0" EndIf If GUICtrlRead($O_DA) = $Gui_Checked Then $O___ = "16384" Else $O___ = "0" EndIf If GUICtrlRead($P_DA) = $Gui_Checked Then $P___ = "32768" Else $P___ = "0" EndIf If GUICtrlRead($Q_DA) = $Gui_Checked Then $Q___ = "65536" Else $Q___ = "0" EndIf If GUICtrlRead($R_DA) = $Gui_Checked Then $R___ = "131072" Else $R___ = "0" EndIf If GUICtrlRead($S_DA) = $Gui_Checked Then $S___ = "262144" Else $S___ = "0" EndIf If GUICtrlRead($T_DA) = $Gui_Checked Then $T___ = "524288" Else $T___ = "0" EndIf If GUICtrlRead($U_DA) = $Gui_Checked Then $U___ = "1048576" Else $U___ = "0" EndIf If GUICtrlRead($V_DA) = $Gui_Checked Then $V___ = "2097152" Else $V___ = "0" EndIf If GUICtrlRead($W_DA) = $Gui_Checked Then $W___ = "4194304" Else $W___ = "0" EndIf If GUICtrlRead($X_DA) = $Gui_Checked Then $X___ = "8388608" Else $X___ = "0" EndIf If GUICtrlRead($Y_DA) = $Gui_Checked Then $Y___ = "16777216" Else $Y___ = "0" EndIf If GUICtrlRead($Z_DA) = $Gui_Checked Then $Z___ = "33554432" Else $Z___ = "0" EndIf ;======================================== $DisableDriveType = $1_ + $2_ + $3_ + $4_ $HideDrives = $A_ + $B_ + $C_ + $D_ + $E_ + $F_ + $G_ + $H_ + $I_ + $J_ + $K_ + $L_ + $M_ + $N_ + $O_ + $P_ + $Q_ + $R_ + $S_ + $T_ + $U_ + $V_ + $W_ + $X_ + $Y_ + $Z_ $PreventAcessToDrives = $A__ + $B__ + $C__ + $D__ + $E__ + $F__ + $G__ + $H__ + $I__ + $J__ + $K__ + $L__ + $M__ + $N__ + $O__ + $P__ + $Q__ + $R__ + $S__ + $T__ + $U__ + $V__ + $W__ + $X__ + $Y__ + $Z__ $DisableDriveAutorun = $A___ + $B___ + $C___ + $D___ + $E___ + $F___ + $G___ + $H___ + $I___ + $J___ + $K___ + $L___ + $M___ + $N___ + $O___ + $P___ + $Q___ + $R___ + $S___ + $T___ + $U___ + $V___ + $W___ + $X___ + $Y___ + $Z___ $RegKeyHKCU = "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer" $RegKeyHKLM = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer" $NoDrives = "NoDrives" ;Hide Drives $NoViewOnDrive = "NoViewOnDrive" ;Prevent Access to Drives $NoDriveAutoRun = "NoDriveAutoRun" ;Disable autorun on selected drives $NoDriveTypeAutoRun = "NoDriveTypeAutoRun" ;Disable autorun on drive type $RegType = "REG_DWORD" RegWrite($RegKeyHKCU, $NoDrives, $RegType, $HideDrives) RegWrite($RegKeyHKLM, $NoDrives, $RegType, $HideDrives) RegWrite($RegKeyHKCU, $NoViewOnDrive, $RegType, $PreventAcessToDrives) RegWrite($RegKeyHKLM, $NoViewOnDrive, $RegType, $PreventAcessToDrives) RegWrite($RegKeyHKCU, $NoDriveAutoRun, $RegType, $DisableDriveAutorun) RegWrite($RegKeyHKLM, $NoDriveAutoRun, $RegType, $DisableDriveAutorun) RegWrite($RegKeyHKCU, $NoDriveTypeAutoRun, $RegType, $DisableDriveType) RegWrite($RegKeyHKLM, $NoDriveTypeAutoRun, $RegType, $DisableDriveType) If GUICtrlRead($ExternalWriteProtect) = $Gui_Checked Then RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "REG_DWORD", "1") RegWrite("HKCU\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "REG_DWORD", "1") Else RegWrite("HKLM\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "REG_DWORD", "0") RegWrite("HKCU\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "REG_DWORD", "0") EndIf GUICtrlSetData($Label2, "Ready") ;Call activate changes activatechanges() Exit EndFunc ;==>ApplyRestrictionsatExit Func ApplyPassword() Local $Button1, $Label1, $Label2, $Button2, $CheckPass, $getpass, $finagetpass $CheckPass = RegRead("HKCU\SOFTWARE\DiskDriveAdmin", "Password") $getpass = _HexToString($CheckPass) $finagetpass = _HexToString($getpass) #Region ### START Koda GUI section ### Form= $hwnd2 = GUICreate("Password", 201, 144, -1, -1, 0x94C800C4) GUISetIcon("shell32.dll", 50) $Input1_pass = GUICtrlCreateInput("", 8, 36, 185, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL)) GUICtrlSetData(-1, $finagetpass) $Button1 = GUICtrlCreateButton("Ok", 32, 112, 65, 25, 0) $Label1 = GUICtrlCreateLabel("Enter password:", 8, 16, 80, 17) $Input2_pass = GUICtrlCreateInput("", 7, 89, 185, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL)) GUICtrlSetData(-1, $finagetpass) $Label2 = GUICtrlCreateLabel("Reenter password:", 7, 69, 93, 17) $Button2 = GUICtrlCreateButton("Cancel", 104, 112, 65, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUISetOnEvent($GUI_EVENT_CLOSE, "close") GUICtrlSetOnEvent($Button1, "addpassword") GUICtrlSetOnEvent($Button2, "close") EndFunc ;==>ApplyPassword Func about() Local $Button1, $Group1, $Label1, $Label2, $Label3, $Label4, $Label5, $Label6, $Label7, $Label8, $Label9 #Region ### START Koda GUI section ### Form=F:\au2it\Projects\Disk Drive Administrator\about.kxf $hwnd2 = GUICreate("About", 318, 228, -1, -1, 0x94C800C4) GUISetIcon("shell32.dll", 50) GUISetIcon(@ScriptDir & "\images\disklock.ico") $Group1 = GUICtrlCreateGroup("", 8, 8, 65, 73) $icon1 = GUICtrlCreateIcon(@ScriptDir & "\images\disklock.ico", 0, 24, 32, 32, 32, BitOR($SS_NOTIFY, $WS_GROUP)) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label1 = GUICtrlCreateLabel("Disk Drive Administrator", 88, 16, 201, 28) GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Version: 1.0", 88, 48, 120, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Label3 = GUICtrlCreateLabel("March 10, 2009", 88, 72, 133, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Label4 = GUICtrlCreateLabel("Copyright:", 24, 112, 51, 17) $Label6 = GUICtrlCreateLabel("Home:", 40, 136, 35, 17) $Button1 = GUICtrlCreateButton("Ok", 8, 192, 83, 25, 0) $Label7 = GUICtrlCreateLabel("Bernando A. Minguita Jr | euverve", 88, 112, 164, 17) $Label8 = GUICtrlCreateLabel("http://www.pinoygeeks.co.cc", 88, 136, 146, 17) GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000FF) $Label5 = GUICtrlCreateLabel("Email: ", 40, 160, 35, 17) $Label9 = GUICtrlCreateLabel("euverve@gmail.com", 84, 162, 101, 17) GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif") GUICtrlSetColor(-1, 0x0000FF) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUISetOnEvent($GUI_EVENT_CLOSE, "close") GUICtrlSetOnEvent($Button1, "close") EndFunc ;==>about Func addpassword() Local $data, $newdata, $finaldata If GUICtrlRead($Input1_pass) = GUICtrlRead($Input2_pass) Then $data = GUICtrlRead($Input1_pass) $newdata = _StringToHex($data) $finaldata = _StringToHex($newdata) RegWrite("HKCU\SOFTWARE\DiskDriveAdmin", "Password", "REG_SZ", $finaldata) GUICtrlSetData($Label2, "Password Applied") GUIDelete($hwnd2) Sleep(50) GUICtrlSetData($Label2, "Ready") Else MsgBox(16, "Error", "Invalid Password!") GUICtrlSetData($Label2, "Invalid Password") GUICtrlSetData($Input1_pass, "") GUICtrlSetData($Input2_pass, "") Sleep(50) GUICtrlSetData($Label2, "Ready") EndIf EndFunc ;==>addpassword ; ================================================ Func checkstate() While 1 If GUICtrlRead($A_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($A_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($A_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($B_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($B_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($B_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($C_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($C_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($C_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($D_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($D_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($D_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($E_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($E_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($E_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($F_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($F_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($F_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($G_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($G_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($G_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($H_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($H_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($H_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($I_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($I_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($I_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($J_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($J_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($J_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($K_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($K_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($K_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($L_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($L_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($L_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($M_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($M_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($M_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($N_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($N_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($N_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($O_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($O_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($O_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($P_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($P_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($P_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($Q_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($Q_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($Q_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($R_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($R_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($R_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($S_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($S_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($S_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($T_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($T_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($T_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($U_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($U_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($U_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($V_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($V_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($V_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($W_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($W_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($W_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($X_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($X_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($X_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($Y_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($Y_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($Y_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($Z_hide) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($Z_lock) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($Z_DA) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ;~ ElseIf GUICtrlRead($HDDs) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($CDDVD) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($USBFLOPPY) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($RAMDISKS) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() ElseIf GUICtrlRead($ExternalWriteProtect) = $Gui_Checked Then GUICtrlSetState($Button1Apply, $GUI_ENABLE) AdlibDisable() EndIf ExitLoop WEnd EndFunc ;==>checkstate func progPurpose() #Region ### START Koda GUI section ### Form= Local $Edit1, $closepurpose $hwnd2 = GUICreate("Purpose of the Program", 425, 279, -1, -1) $Edit1 = GUICtrlCreateEdit("", 8, 8, 409, 233, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_BORDER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) GUICtrlSetData(-1, StringFormat("\r\n Use this password-protected security utility to hide and lock your local, network, \r\n Floppy and USB drives as well as disable the AutoRun feature for them. \r\n\r\n The design of the program is very simple. \r\n\r\n The main window contains the boxes with drive settings that represent\r\n individual drives and the toolbar used for applying changes. All you need to \r\n do is to click on the checkboxes with settings and after you finish press the \r\n apply button. \r\n\r\n If desired, you can apply password protection to the program to prevent your \r\n users from changing the security settings you enforce. This software has a very \r\n nice easy-to-learn user interface. ")) $closepurpose = GUICtrlCreateButton("Close", 336, 248, 83, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUISetOnEvent($GUI_EVENT_CLOSE, "close") GUICtrlSetOnEvent($closepurpose, "close") EndFunc func proghelp() #Region ### START Koda GUI section ### Form=C:\Documents and Settings\Thatskie\Desktop\da_Help.kxf Local $Edit1, $closehelp $hwnd2 = GUICreate("Program Help", 426, 278, -1, -1) $Edit1 = GUICtrlCreateEdit("", 8, 8, 409, 233, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_VSCROLL,$WS_BORDER), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) GUICtrlSetData(-1, StringFormat("\r\n To hide and lock your individual drives as well as disable the AutoRun feature \r\n for them, use the checkboxes with settings that represent individual drives.\r\n \r\n To disable the AutoRun feature for drive types, use the last group box located \r\n at the right bottom corner of the main window. This box of settings lets you \r\n disable the AutoRun feature for all Floppy/USB drives, all removable HDD \r\n drives, all RAM disks and all CD/DVD disks.\r\n \r\n To apply changes to your PC, you need to press the Apply button and confirm \r\n that you really want to apply them. You will need to reboot your PC to activate \r\n changes.\r\n \r\n If you need to password-protect the program press the Password button. \r\n Enter your password two times to make sure it is correct and press the \r\n Ok button. If you need to reset your current password, just clear the both fields \r\n in the dialog box where you are prompted to enter the new password.\r\n")) $closehelp = GUICtrlCreateButton("Close", 336, 248, 83, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUISetOnEvent($GUI_EVENT_CLOSE, "close") GUICtrlSetOnEvent($closehelp, "close") EndFunc Func askpassword() Local $verifypass, $Label1, $Button2 #Region ### START Koda GUI section ### Form=F:\au2it\Projects\Disk Drive Administrator\Copy of Password.kxf $hwnd2 = GUICreate("Password", 224, 105, -1, -1, 0x94C800C4) GUISetIcon("shell32.dll", 50) $pass1 = GUICtrlCreateInput("", 8, 36, 209, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL)) $verifypass = GUICtrlCreateButton("Ok", 32, 72, 73, 25, 0) $Label1 = GUICtrlCreateLabel("Enter password:", 8, 16, 80, 17) $Button2 = GUICtrlCreateButton("Cancel", 120, 72, 73, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUISetOnEvent($GUI_EVENT_CLOSE, "exit_") GUICtrlSetOnEvent($verifypass, "verify") GUICtrlSetOnEvent($Button2, "exit_") EndFunc ;==>askpassword Func verify() Local $getpass, $finalPass $getpass = _HexToString($CheckPass) $finalPass = _HexToString($getpass) While 1 If GUICtrlRead($pass1) = $finalPass Then close() MainForm() Else MsgBox(16, "Error", "Invalid Password!") Exit EndIf ExitLoop WEnd EndFunc ;==>verify Func exit_() Exit EndFunc ;==>exit_ func activatechanges() Local $shell $shell = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "Shell") #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=Yes and No, Icon=Info If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(68,"Information","Do you want to activate changes now?") Select Case $iMsgBoxAnswer = 6 ;Yes ProcessClose($shell) Case $iMsgBoxAnswer = 7 ;No MsgBox(64,"Information","Reboot computer to activate changes.") EndSelect #EndRegion --- CodeWizard generated code End --- EndFunc Executable File: Download: http://www.4shared.com/file/93328604/455d3249/Disk_Drive_Administrator.html Comments appreciated, and also if you any suggestions regarding the scripts please post a reply. Link to comment Share on other sites More sharing options...
James Posted March 17, 2009 Share Posted March 17, 2009 You spelt "storagge" wrong on your screenshot Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted March 18, 2009 Share Posted March 18, 2009 Thanks for sharing.. if i were you i would embed the .ico file #AutoIt3Wrapper_Res_Icon_Add=c:\path\file.ico you will need resource hacker and the GUIWrapper This allows you to use the .ico with @scriptname, Value without extracting the file with fileinstall Best regards, Emiel Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
euverve Posted March 19, 2009 Author Share Posted March 19, 2009 Thanks for sharing..if i were you i would embed the .ico file #AutoIt3Wrapper_Res_Icon_Add=c:\path\file.ico you will need resource hacker and the GUIWrapperThis allows you to use the .ico with @scriptname, Value without extracting the file with fileinstallBest regards,EmielThanks for the information. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now