I have created a vbscript that will search for a particular app and then once found I need to uninstall the app. The problem I am having is that I get an error when trying to run the uninstall, I get "The system cannot find the file specified" when I echo the path it is correct so I am not sure if I missed something here or not. Any help would be appreciated.
See script below...
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("scripting.FileSystemObject")
sProgramFiles = oShell.RegRead _
("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir")
sFile = sProgramFiles & "\VideoLAN\VLC\uninstall.exe"
WScript.Echo (sFile) 'for testing only
If oFSO.FileExists(sFile) Then
oShell.Run sFile /S, 1, True
WScript.Echo ("Installed...removing") 'for testing only
Else
WScript.Echo ("Not Installed") 'for testing only
WScript.Quit
End If
See script below...
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("scripting.FileSystemObject")
sProgramFiles = oShell.RegRead _
("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir")
sFile = sProgramFiles & "\VideoLAN\VLC\uninstall.exe"
WScript.Echo (sFile) 'for testing only
If oFSO.FileExists(sFile) Then
oShell.Run sFile /S, 1, True
WScript.Echo ("Installed...removing") 'for testing only
Else
WScript.Echo ("Not Installed") 'for testing only
WScript.Quit
End If