Solved

How I determine OS Type with KiXtart

Posted on 2011-09-17
4
1,463 Views
Last Modified: 2013-12-23
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
0
Comment
Question by:dstempfley
4 Comments
 
LVL 10

Expert Comment

by:acbxyz
Comment Utility
@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
0
 
LVL 37

Accepted Solution

by:
Gerwin Jansen earned 125 total points
Comment Utility
The dos command ver will return both Windows version and build number, for example for W7:

Microsoft Windows [Version 6.1.7601]

Here is a reference to the OS versions: msdn
0
 
LVL 15

Expert Comment

by:riteheer
Comment Utility
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now