Solved

login script and batch file

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
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…

772 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

12 Experts available now in Live!

Get 1:1 Help Now