Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I create a script wrapper for uninstalling the bellow string asuming that I have the uninst_setup.iss file saved on desktop?

C:\Program Files\InstallShield Installation Information\{4D9CA1B8-5FF5-47A7-8BDF-C37D1F9F55A5}\setup.exe" -l0x9 -removeonly -uninst /s /f1"c:\temp\uninst_setup.iss" /f2"c:\temp\setuppec.log

I can uninstall the string manually if I copy the uninst_setup.iss file to c:\temp then ran the above string in cmd.

I just need help on creating a wrapper to uninstall it on one shot through SCCM.

share|improve this question
    
Anybody there with an idea please? –  MaestroIT Nov 23 '12 at 15:58

1 Answer 1

You shouldn't be using a hardcoded temporary directory. The code below would help you with that. Just take note running this with SCCM (SYSTEM account), the temp directory would resolve to %windir%\temp.

Add a script (eg uninstaller.vbs) with the code below, and the iss file to an SCCM package. Create a program with the following command: cscript.exe uninstaller.vbs

set wsh_shell = createobject("wscript.shell")
set fso = createobject("scripting.filesystemobject")

dq = chr(34)
source_path = fso.getparentfoldername(wscript.scriptfullname)
tmp_folder = fso.getSpecialFolder(2)
iss_file = "uninst_setup.iss"
log_file = "setuppec.log"

' Copy the iss file to the temp folder.
fso.copyFile fso.buildPath(source_path, iss_file), tmp_folder, true

' Build the command line
cmd = dq &"C:\Program Files\InstallShield Installation Information\{4D9CA1B8-5FF5-47A7-8BDF-C37D1F9F55A5}\setup.exe" &dq
cmd = cmd &" -l0x9 -removeonly -uninst /s /f1" &dq &fso.buildpath(tmp_folder, iss_file) &dq
cmd = cmd &" /f2" &dq &fso.buildpath(tmp_folder, log_file) &dq

' Run commandline and return exit code to sccm.
wscript.quit wsh_shell.run(cmd, 0, true)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.