Bonjour a tous,
J'aurais aimé savoir s'il était possible, dans un script d'ouverture de session au début qu'il vérifie la version de l'os et qu'il poursuit ou non le script en fonction de L'OS. en VBS
Merci d'avance
Version imprimable
Bonjour a tous,
J'aurais aimé savoir s'il était possible, dans un script d'ouverture de session au début qu'il vérifie la version de l'os et qu'il poursuit ou non le script en fonction de L'OS. en VBS
Merci d'avance
Bonjour,
Un début de piste ?
Code:
1
2
3
4
5
6
7
8
9 Set SystemSet = GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem") for each System in SystemSet if uCase(Trim(System.Caption)) = "MICROSOFT WINDOWS XP PROFESSIONNEL" then exit for elseif uCase(Trim(System.Caption)) = "MICROSOFT WINDOWS 7 PROFESSIONNEL" then exit for end if next
Bonjour,
Dans le même style :
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 strComputer = "." ' WMI Connection to the object in the CIM namespace Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem") '--------------------------------------------------------------------------- 'OS For Each objItem in colItems MsgBox "Operating System;" & objItem.Caption MsgBox "Version;" & objItem.Version MsgBox "Service Pack;" & objItem.CSDVersion If (objItem.Caption="Microsoft Windows 7 Entreprise ") Then 'TonAction Else Exit For End If Next
Merci beaucoup ça fonctionne et avec les 2 scripts :D
merci