Code : Tout sélectionner
#include <GUIConstantsEx.au3>
#Include <GuiTreeView.au3>
MsgBox(1, "Plop", "Placez vous sur votre bureau avant de continuer.", 0)
DIM $var
$var = 0
if $var = 0 then
BlockInput (1)
Run('cmd.exe' & " /c " & 'net use * /delete', "")
WinWaitNotActive("ConsoleWindowClass")
send( 'o' & "{enter}")
BlockInput (0)
sleep('1000')
$var = 1
endif
$passwd = InputBox("Plop", "Entrez le mot de passe.", "", "*")
if $passwd = "pass" then
Local $checkCN0, $checkCN1, $checkCN2, $checkCN3, $checkCN4
Opt("GUIOnEventMode", 1)
$mainwindow = GUICreate("plop", 200, 100)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUICtrlCreateLabel("Quel lecteur voulez-vous ajouter?", 30, 10)
$checkCN0 = GUICtrlCreateCheckbox("L:\\nas\testdell", 10, 30, 120, 20)
$checkCN1 = GUICtrlCreateCheckbox("Q:\\edcca\askiaqes", 10, 60, 120, 20)
$checkCN2 = GUICtrlCreateCheckbox("F:\\ed1\sys", 10, 90, 120, 20)
$checkCN3 = GUICtrlCreateCheckbox("R:\\edaskia2\record", 10, 120, 120, 20)
$checkCN4 = GUICtrlCreateCheckbox("S:\\iomega\nethdd", 10, 150, 120, 20)
$okbutton = GUICtrlCreateButton("OK", 70, 220, 60)
GUICtrlSetOnEvent($okbutton, "OKButton")
GUISetState(@SW_SHOW)
else
MsgBox(0, "plop", "Perdu essaye encore.", 0)
endif
If BitAnd ( GuiCtrlRead ( $checkCN0 ) , $GUI_CHECKED ) Then
DriveMapDel("L:")
DriveMapAdd("L:", "\\nas\testdell", 0, "admin", "*****")
endif
If BitAnd ( GuiCtrlRead ( $checkCN0 ) , $GUI_CHECKED ) Then
DriveMapDel("Q:")
DriveMapAdd("Q:", "\\edcca\askiaqes", 0, "admin", "*****")
endif
If BitAnd ( GuiCtrlRead ( $checkCN0 ) , $GUI_CHECKED ) Then
DriveMapDel("F:")
DriveMapAdd("F:", "\\ed1\sys", 0, "admin", "*****")
endif
If BitAnd ( GuiCtrlRead ( $checkCN0 ) , $GUI_CHECKED ) Then
DriveMapDel("R:")
DriveMapAdd("R:", "\\edaskia2\record", 0, "admin", "*****")
endif
If BitAnd ( GuiCtrlRead ( $checkCN0 ) , $GUI_CHECKED ) Then
DriveMapDel("S:")
DriveMapAdd("S:", "\\iomega\nethdd", 0, "admin", "*****")
endif
Func OKButton()
MsgBox(0, "GUI Event", "Vous avez appuyé OK !")
EndFunc
Func CLOSEClicked()
Exit
EndFunc