Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uninstalling software Forcefully and Silently

Status
Not open for further replies.

k3y3n1n

IS-IT--Management
Mar 6, 2009
15
US
I made vbs to uninstall act v6 from my computer. The vbs works but I have to click next and Yes to all. I need help on making it by pass that and automatically uninstall everything with out prompting me.
---------------------------------------------------------
Set WshShell = Nothing
Set oReg = Nothing

const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
Set WshShell = WScript.CreateObject("WScript.Shell")

' Uninstall first application...
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ACT!"
strValueName = "UninstallString"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strUninstallFullPath
If IsNull(strUninstallFullPath) Then
' wscript.echo "Uninstall path for app1 is null"
Else

WshShell.Run strUninstallFullPath,8,true

End If
 
Check the setup file, it may have a /Q switch for quiet uninstall.

Otherwise you could look at using the SendKeys method to fire off the keys that are associated with the buttons you are pressing. For example try the uninstall and don't use your mouse. Alt+O will usually be associated with OK and Alt+N for next.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
See I want to push this out through group policy as a log on script so I really don’t want the users seeing it getting uninstalled.


When I go to the uninstall file this is target:
"C:\WINDOWS\IsUnInstAct.exe -f"C:\Program Files\ACT\Uninst6.isu" -c"C:\Program Files\ACT\UNINSTAL.DLL"

I don’t know if that helps you.
 
I am suggesting that you take a different approach. Find the ACT installer. Run it from a command prompt with a /? at the end to see if there are any switches available. From there you can determine if you can script the uninstall.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Thats the first thing I did and no help menu came up it just ran the exe.
 
Ok so I tried a different approach since I am having a hard time finding the right switches to run it silently and forcefully I am trying to use Send Keys in my vbs but for some reason they work and sometimes they don’t work i don’t know here is my updated code some please help.
-----------------------------------------------------------------------------------------------------------------------------------
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
Set WshShell = WScript.CreateObject("WScript.Shell")
' Uninstall first application...
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ACT!"
strValueName = "UninstallString"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strUninstallFullPath
If IsNull(strUninstallFullPath) Then
' wscript.echo "Uninstall path for app1 is null"
Else
WshShell.Run strUninstallFullPath,8,true

Set oShell = CreateObject("Wscript.Shell")
oShell.AppActivate ("Confirm File Deletion")
oShell.SendKeys "ENTER"
oshell.AppActivate ("Remove Program Files?")
oshell.SendKeys "TAB""ENTER"
End If
Set WshShell = Nothing
Set oReg = Nothing


_____________________________

Dcataldo
 
Using SendKeys's optional Wait argument can sometimes help; as in;
oShell.SendKeys "ENTER", True
 
I'd toss in a WSCRIPT.SLEEP 1000 to introduce a 1 second delay before using send keys.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Markdmac were would I throw that command after each send key command for example:

Set oShell = CreateObject("Wscript.Shell")
oShell.AppActivate ("Confirm File Deletion")
oShell.SendKeys "{ENTER}", True <-------(and is this Right)
WSCRIPT.SLEEP 1000<-(I would change this to oshell.sleep 1000)
oshell.AppActivate ("Remove Program Files?")
oshell.SendKeys "TAB""ENTER"

 
... and to simulate pressing the enter key followed by return you should use "{TAB}{ENTER}", True
 
Ok guys after trying so hard with my vbs and sendkeys the ans was in front of my face the whole time. I found it by mistake but hey I don’t care it works lol. Here the line to uninstall it silently forcefully and delete all files.. I thank everyone for their help and participation.
 
C:\WINDOWS\IsUnInstAct.exe -f"C:\Program Files\ACT\Uninst6.isu" -c"C:\Program Files\ACT\UNINSTAL.DLL" -a -x

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top