Link to home
Start Free TrialLog in
Avatar of jvleigh221
jvleigh221Flag for United States of America

asked on

Scripting a login script for the possiblilty of different directories

Windows 2003 Server, Win 2000 and XP clients

I need to create a login script that silently uninstalls an antivirus program.
I already have the commands necessary to uninstall the program, however the program I need to uninstall may resides in one of two different directories depending on what version the user had at the time of install.
So the problem I have is how to write the script so that it works like this:

If this directory exists run this command
else run this other command

Thank you.
Jeremy Leigh
ASKER CERTIFIED SOLUTION
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't have a 2000 machine to test on, but the "IF EXIST" batch command works on 2K3 & XP:

IF EXIST C:\Windows \\server1\uninstallfromwindows.exe
IF EXIST C:\Winnt \\server1\uninstallfromwinnt.exe
...etc.
It works in 2000 - and I believe NT4 as well.  Possibly even 9x.
Avatar of jvleigh221

ASKER

Thank you...That was exactly what I was looking for...much appreciation.