Link to home
Start Free TrialLog in
Avatar of TexasPlowBoy
TexasPlowBoy

asked on

VBScript to uninstall app with command line switch

I am trying to build a GPO which will run a vbscript at login on users Windows XP machines with Client Side Extensions installed.

In the script, I seach to see if the uninstall.exe is there and if so, then I try and run the following:

WshShell.Run ("%comspec% /c c:\progra~1\spark\uninstall.exe -q")

I try and run with %comspec% so I can use command line switches.  The vbscript, when run outside of the login script seems to work but if I try and run it via a login script, users get the following and the app will not run:

"CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory"

I am not stuck on using comspec but I am really looking for a way to utilize the login script to run the uninstall.exe with the -q command line option.

Any assistance is appreciated.
Avatar of Mariano
Mariano
Flag of Spain image

you can create a bat in the path where the CMD starts. within the batch file you run all the statements you need. such as changing unit, launch an exe, etc. ..
Hi,

Why not just write it this way?

set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("cmd.exe /c c:\progra~1\spark\uninstall.exe -q")

Open in new window


I don't think you need to run full c:\windows\system\cmd.exe /c... for your command.

Comspec will always called CMD.EXE in Windows 2000 above, and access to CMD.EXE basically already declare on PATH variables.

ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia 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