bobbintb Posted September 30, 2009 Share Posted September 30, 2009 Is there a way to find out if I am running Windows 7, short of looking at the OS type and build number? @OSVersion displays it as Vista. Link to comment Share on other sites More sharing options...
dantay9 Posted September 30, 2009 Share Posted September 30, 2009 I do not have Windows 7 so I can't test this, but here is a little extra past what @OSVersion will give you. Func _GetOSVersion() Local $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Local $colSettings = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem") For $objOperatingSystem In $colSettings ;~ Return $objOperatingSystem.Caption Return StringMid($objOperatingSystem.Caption, 19) Next EndFunc ;==>_getOSVersion Link to comment Share on other sites More sharing options...
UEZ Posted September 30, 2009 Share Posted September 30, 2009 (edited) Or run latest beta -> it is fixed there. UEZ Edited September 30, 2009 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
venturiniluciano Posted September 30, 2009 Share Posted September 30, 2009 Is there a way to find out if I am running Windows 7, short of looking at the OS type and build number? @OSVersion displays it as Vista. italian = "il mio primo post, spero di aver capito" Dim $ProductName,$CSDVersion,$BuildLab,$ProductId $ProductName = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName") $CSDVersion = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CSDVersion") $BuildLab = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "BuildLab") $ProductId = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductId") MsgBox(64, "","Informazioni sistema"&@CRLF&"Il tuo sistema operativo è: "&$ProductName&@CRLF&"Il tuo sistema service pack è: "&$CSDVersion&@CRLF&"Il tuo numero di laboratorio è: "&$BuildLab&@CRLF&"Il tuo id del prodotto è: "&$ProductId ) Link to comment Share on other sites More sharing options...
bobbintb Posted September 30, 2009 Author Share Posted September 30, 2009 thanks. i went to the beta but for some reason when i run the script in scite it doesnt work. only when i right click on the script and run it. Link to comment Share on other sites More sharing options...
Kerros Posted October 1, 2009 Share Posted October 1, 2009 I run testing on various OS's including Windows 7, and until the next release when the macro should be updated to include Windows 7, I put in a check of the registry to include what build number is running. This is the function I use to return What OS, service pack and if we are running an 64 bit OS. _OSVersion() Func _OSVersion() Local $OS_Version, $servicepack_version $OS_Version = StringStripWS(StringRegExpReplace(@OSVersion, "(WIN_)|(Microsoft )|(Windows )|(\(TM\))|( Ultimate)", ""), 8) $OS_Version = StringRegExpReplace(StringRegExpReplace($OS_Version, '2008', 'Win7'), 'VISTA', 'Vista') If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", 'CurrentBuildNumber') > 7000 Then $OS_Version = 'Win7' $servicepack_version = StringReplace(@OSServicePack, "Service Pack ", "SP") If @error = -1 Then $servicepack_version = "" ConsoleWrite($OS_Version & $servicepack_version & StringRegExpReplace(@OSArch, '(X86)', '') & @CRLF) Return $OS_Version & $servicepack_version & StringRegExpReplace(@OSArch, '(X86)', '') EndFunc ;==>_OSVersion Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now