Solved

login script and batch file

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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
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.

690 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