Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SpadeEagle44 authored Apr 23, 2023
0 parents commit cfc8e20
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions check_windows_version.vbs
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)

0 comments on commit cfc8e20

Please sign in to comment.