login script question

  • Thread starter Thread starter tsuru
  • Start date Start date
T

tsuru

How would you script a login to run something dependent
upon whether or not the pagefile file is found (i.e. run
the script only if it is not a Win98 machine)?

Can anyone tell me the script for checking this while
logging in so that dependent upon if or if not the
pagefile file is found it will run an executable for me?

Thanks
 
You might get better results/answers by posting this query in:
microsoft.public.windows.server.scripting

Dave





| How would you script a login to run something dependent
| upon whether or not the pagefile file is found (i.e. run
| the script only if it is not a Win98 machine)?
|
| Can anyone tell me the script for checking this while
| logging in so that dependent upon if or if not the
| pagefile file is found it will run an executable for me?
|
| Thanks
 
There are better ways to check if a machine runs Win9x or not.
Here are a couple of examples:

@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%

@echo off
if not "%SystemRoot%"=="" goto Win2000
 
Very clean. Thanks.

--
Mark-Allen Perry
ALPHA Systems, Switzerland
mark-allen AT mvps DOT org

There are better ways to check if a machine runs Win9x or not.
Here are a couple of examples:

@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%

@echo off
if not "%SystemRoot%"=="" goto Win2000
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top