Solved

login script and batch file

Posted on 2004-10-04
2
12,250 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
  • 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Compromised PC? 17 168
Problem to error 4 43
Place to store Android app 19 43
cmd: can't connect using netsh command 14 29
Update 11/3/2014 - Although the below article will get you to relocate the WINSXS folder, Microsoft has finally released a utility to reduce the size of the WINSXS folder. For some reason, it's not that straightforward. It only works on Windows 2008…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

930 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

13 Experts available now in Live!

Get 1:1 Help Now