-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cfc8e20
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'============================================================================== | ||
' Auteur : John Gonzalez | ||
'============================================================================== | ||
|
||
'============================================================================== | ||
' Version : 1.0.0.0 | ||
'============================================================================== | ||
|
||
Set arguments = WScript.Arguments | ||
script = "check_windows_version" | ||
version = "1.0.0" | ||
author = "John Gonzalez" | ||
verbose = False | ||
|
||
For i = 0 To arguments.Count - 1 | ||
If arguments.Item(i) = "-v" Then | ||
verbose = True | ||
Exit For | ||
ElseIf Left(arguments.Item(i), 1) = "-" Then | ||
WScript.Echo "Invalid option: " & arguments.Item(i) | ||
WScript.Quit 1 | ||
End If | ||
Next | ||
|
||
If verbose Then | ||
WScript.Echo script & " - " & author & " - " & version | ||
WScript.Quit 0 | ||
End If | ||
|
||
On Error Resume Next | ||
|
||
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") | ||
Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem") | ||
|
||
For Each objOperatingSystem in colOperatingSystems | ||
WScript.StdOut.Write objOperatingSystem.Caption & " " & objOperatingSystem.Version | ||
Next | ||
|
||
WScript.Quit(0) |