From cfc8e20b0f796b42943abb19c53f4776d29f21ed Mon Sep 17 00:00:00 2001 From: John G Date: Sun, 23 Apr 2023 10:28:47 +0200 Subject: [PATCH] Add files via upload --- check_windows_version.vbs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 check_windows_version.vbs diff --git a/check_windows_version.vbs b/check_windows_version.vbs new file mode 100644 index 0000000..f36b17b --- /dev/null +++ b/check_windows_version.vbs @@ -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) \ No newline at end of file