1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
   | strComputer = "."
Dim NumSerie,chemin
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Ws = WScript.CreateObject("WScript.Shell")
 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_DiskDrive WHERE InterfaceType='USB'",,48)
intCount = 0
For Each drive In colItems
    If drive.mediaType <> "" Then
        intCount = intCount + 1
    End If
Next
If intCount > 0 Then
    MsgBox "Votre Clé USB Personnelle est bien Connectée !",64,"Flash Drive Check © Hackoo!"
 
  For Each Drive In fso.Drives
  If Drive.IsReady Then
  If Drive.DriveType=1 Then
  NumSerie=fso.Drives(Drive + "\").SerialNumber
  Amovible=fso.Drives(Drive + "\")
  Numserie=ABS(INT(Numserie))
  volume=fso.Drives(Drive + "\").VolumeName
  chemin=Ws.SpecialFolders("MyDocuments")
  'msgbox Amovible
 MsgBox Ws.SpecialFolders("MyDocuments"),64,"Mes Documents" 
'Com = "cmd /c xcopy.exe " & chemin&" "&Amovible &" /D /s /e /H /R"
Com = "cmd /c xcopy.exe " & Ws.SpecialFolders("MyDocuments")&" "&Amovible &" /D /s /e /H /R"
Result = Ws.Run(Com,0,True)
 end if
  End If
 Next
  'MsgBox "La Clé Usb inséré a comme Num° de Série "&NumSerie,64,"Vérification Clé Usb © Hackoo"
  else
 
   MsgBox Ws.SpecialFolders("MyDocuments"),64,"Mes Documents"
	Ws.Run "cmd /c @echo " & beep, 0
	wscript.sleep 1000
	MsgBox "Votre Clé USB Personnelle n'est pas Connectée ",48,"Flash Drive Check © Hackoo !"
End If | 
Partager