Link to home
Start Free TrialLog in
Avatar of dstempfley
dstempfley

asked on

How I determine OS Type with KiXtart

I've found the @DOS and @PRODUCTTYPE macros within KiXtart to get the OS information, but I can't find a reference that will tell me the possible values and how they relate to the operating system version.  For example on my Windows 7 installation @DOS returns 6.1  

I've also seen VBScript code that gets information from  winmgmts: Win32_Operatingsystem Caption

If I'm trying to write and enterprise script that is going to do its best anticipate the returning values what is the most reliable way to get the operating system version.  

My current problem is that I am trying to read the logon provider from the registry and the location is different when you use Windows 7.

For Windows 7 I use:
  Temp = ReadReg("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\LastLoggedOnProvider")
    LogonProvider = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\" & Temp & "\"
    Temp = ReadReg(LogonProvider)

For other Windows I use:
    Temp = ReadReg("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName")


Thank you,
Dion
Avatar of acbxyz
acbxyz
Flag of Germany image

@DOS returns the windows version as counted internally. Each wikipedia-page about Windows has a "current version" on the right. With this it is not possible to differ between W7 and W2008R2 (both 6.1) nor Vista or W2008 (both 6.0) - but paths are mostly on the same place on these server or desktop versions.
Older windows versions are printed on kixstart help pages
http://www.adminscripteditor.com/syntax.asp?act=v&id=44
In addition, you can use @BUILD, which returns the build number of the os.

If you are still using WinME or older, @INWIN could also be helpful:
http://www.adminscripteditor.com/syntax.asp?r=1&act=v&id=45
ASKER CERTIFIED SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.