Solved

Detection of operating system.

Posted on 2001-06-19
10
270 Views
Last Modified: 2013-12-06
I need to import a registry setting into windows 9x, NT and 2000 machines but the logon script will need to detect the OS to import the correct reg file.
Does anyone know of any files that only exists on 2000 & NT & 9x machines that I can 'IF Exist' on.
0
Comment
Question by:bluematter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 2

Expert Comment

by:ToniVR
ID: 6206610
You mean by script? Check for the system directory under the windows map.
0
 

Author Comment

by:bluematter
ID: 6206859
Sorry.. Yes by script. I need to differentiate between the 3 OS's. (All three OS's have a system & system32 directory under the windows map. Even so you can't IF EXIST to directories)
0
 
LVL 2

Accepted Solution

by:
ToniVR earned 50 total points
ID: 6206916
Detecting the OS by files? Will be tricky.

Win98 only has msconfig.exe
WinNT has bootnt.???

I think you better write a small app that detects the system, and call it in your script. That will be the easiest.

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:vsamtani
ID: 6206964
NT and 2000 have cmd.exe, and 9x have command.com. I would also examine the environment variables on each OS (by typing set in a command prompt). COMSPEC and OS will certainly differentiate NT from 9x - I'm not sure what 2000 has, since I don't have access to one at this moment.

Vijay

0
 
LVL 2

Expert Comment

by:ToniVR
ID: 6206986
checked the OS and COMSPEC on 2000, are the same as NT 4.0
0
 
LVL 3

Expert Comment

by:gmichels
ID: 6207127
*thinking*
What if the machine dual boots? They will have both. Will your script handle them, too?
0
 
LVL 2

Expert Comment

by:ToniVR
ID: 6207156
gmichels, normally dual boot OS'es have their own partition, so that can be solved
0
 
LVL 3

Expert Comment

by:gmichels
ID: 6207176
Normally but you can put both on the same partition (C:\windows and c:\winnt).
I just want to point that out to be sure he considers that in his script.  :-)


0
 
LVL 3

Expert Comment

by:gmichels
ID: 6207197
Also, what about just using the kernels as the reference? Will it be able to look for hidden files in the search?
0
 

Author Comment

by:bluematter
ID: 6207226
In the end folks I used an app I found deep in the depths of the 2000RK called gettype that detects currently running OS (Dual boot sorted) and gives an error level number.  Which is well handy because the reg hawke I needed to import was to set Browser Elections and the like.  So this protects my PDC/BDC's
Thanks anyway chaps/chapets ;o)
 Returns 1 for Windows NT Workstation.
 Returns 2 for Windows 2000 Professional installation.
 Returns 3 for Windows NT Server Non-Domain Controller.
 Returns 4 for Windows 2000 Server Non-Domain Controller.
 Returns 5 for Windows NT Server Domain Controller.
 Returns 6 for Windows 2000 Server Domain Controller.
 Returns 7 for Windows NT [Enterprise/Terminal] Server Domain Controller
 Returns 8 for Windows NT [Enterprise/Terminal] Server Non-Domain Controller
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

628 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