?
Solved

login script and batch file

Posted on 2004-10-04
2
Medium Priority
?
12,255 Views
Last Modified: 2013-12-28
I would like my login sript to execute a batch file for Windows 2000 and XP users only..

Here is an example of my current login script:

--------

@echo off


Echo off

\\svfile\tnsnames\updatetnsnamesoapps.bat

if #%OS%#==## goto WIN95
if %OS%==Windows_NT GOTO NT

:WIN95
net use H: /home



if exist p:\nt.txt goto END
if exist p:\ net use /d p:
net use p: /delete
net use q: /delete
net use x: /delete
net use p: \\svfile\PUBLICwest
net use q: \\svfile\eastinterconnect
net use x: \\svfile\common
goto END

:NT
if %windir%==C:\WTSRV goto END


if exist p:\nt.txt goto END
if exist p:\ net use /d p:
net use p: /delete
net use q: /delete
net use r: /delete
net use x: /delete
net use p: \\svfile\PUBLICwest
net use q: \\svfile\eastinterconnect
net use x: \\svfile\common
net time \\s_nw_sms /set /y

:END

---

I want to add a new statement for \\svfile\ittools\install.bat for ONLY 2000 and XP users... how can this be done?

thanks
0
Comment
Question by:Justin Durrant
[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
  • 2
2 Comments
 
LVL 5

Expert Comment

by:kemp_a
ID: 12224033
A quick way is to dump the output from VER into a file & check for specific versions:


VER >h:\winver.tmp
findstr /B /I XP h:\winver.tmp>nul
IF %ERRORLEVEL%==1 GOTO NotXP
REM DO YOUR XP STUFF HERE
GOTO OSSPECIFICCompleted
:NotXP
findstr /B /I 2000 h:\winver.tmp>nul
IF %ERRORLEVEL%==1 GOTO OSSPECIFICCompleted
REM DO YOUR 2000 STUFF HERE
:OSSPECIFICCompleted

Cheers
0
 
LVL 5

Accepted Solution

by:
kemp_a earned 2000 total points
ID: 12234318
Oh, found a quicker way as outlined here http://www.experts-exchange.com/Operating_Systems/Win2000/Q_20740515.html

VER | Find /C "XP">NUL
IF %ERRORLEVEL%==1 goto NotXP

:NotXP
VER | Find /C "2000">NUL
IF %ERRORLEVEL%==1 goto Not2K

:Not2K

Hope that helps
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

764 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