Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.4k views
in Technique[技术] by (71.8m points)

vbscript - programmatically uninstall software that requires a password (I have it) remotely

I tried in VBS using WMI

On Error GoTo 0 
    'Set objSoftware = objConnection.Get("Win32_Product")
    Set colSoftware = oService.ExecQuery _
    ("Select * from Win32_Product where name='<Product Name Here>'", "WQL", _
    wbemFlagReturnImmediately + wbemFlagForwardOnly)
    
    
    For Each objSoftware In colSoftware
        WScript.Echo objSoftware.Name
    Next

For Each objSoftware in colSoftware
        objSoftware.Uninstall() 'This does not have a password option
    Next

Unfortunately it does not have the ability to accept a password.

To be clear, I already have remote administrative access that isn't the problem. Nor am I looking for msiexec /qn for a silent uninstall.

It is security software we are no longer using and so I need to remove it.

If you goto Add/Remove Programs,Programs and Features, appwiz.cpl and try to uninstall it, it asks for a password, not the administrators password.(I do have the password)

I need a way to enter it programmatically on dozens of remote PC.

I would prefer VBS, but powershell and possibly a few other options could work.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...