Sign in with
Sign up | Sign in
Your question

Login script to run exe depending upon OS

Last response: in Windows 2000/NT
July 27, 2004 5:35:15 PM

Archived from groups: microsoft.public.win2000.group_policy (More info?)

Someone answered my post about checking for the Operating
System and gave me the following script. But I wanted a
little more help please. I want to run something after I
determine the OS:

@echo off
set OpSys=Unknown OS
ver | find /i "Windows 95" > nul
if not ErrorLevel 1 set OpSys=Win95
ver | find /i "Windows 98" > nul
if not ErrorLevel 1 set OpSys=Win98
ver | find /i "Windows NT" > nul
if not ErrorLevel 1 set OpSys=WinNT
ver | find /i "Windows 2000" > nul
if not ErrorLevel 1 set OpSys=Win2K
ver | find /i "Windows XP" > nul
if not ErrorLevel 1 set OpSys=WinXP
echo This machine runs %OpSys%

After I determine if a machine is running Win2K, Win NT,
or WinXP, I want to run a command like:

start \\abcdefg\xyz\ddd.exe

------ dependent upon the OS only being Win2K, WinXP, or
Win NT

Could you help me with this please? I've tried just
adding an IF, then, Else but it doesn't do anything!

Thx in advance for your time,