Issue:
You would like to uninstall Autodesk products using a batch file with PDQ
Solution:
The following instructions explain how to uninstall products from a deployment using the deployment built-in “Uninstall.txt” file.
- Go to the location of the deployment and choose the “SMS_SCCM scripts” folder.
- Open the file <deployment name>_Uninstall.txt in Notepad or a similar text editor.
- First thing after you open the file in Notepad or a similar text editor, is to save the file as ANSI and rename from .txt to .bat
- Choose “File”, the choose “Save As…”
- Go to the directory that you will save the batch file to. Rename the .txt to .bat next to “File name:” and from the “Save as type” choose “All Files (*.*)
- *This next step is very important* - Next to the “Save” button is “Encoding:”. From the “Encoding” drop-down choose “ANSI” and then “Save”.
Note that ANSI encoding is required to create an executable batch file
- Open the created batch file, and enable the uninstallation commands by removing the "::" characters at the beginning of the "::call :funcUninstall" command line for each product that you want to uninstall. For “Manual uninstallation only” you will need to use “Add and Remove programs”
- After removing the “::” characters at the beginning of the "::call :funcUninstall" command line for each product that you want to uninstall, Click “File” at the top and choose “Save”
- Open PDQ Deploy and click “New Package”.
- This next step has 2 different ways to accomplish what we need to do. I will show both ways and you decide the best process for you.
- Click “New Step” from the ribbon and then choose “Command”
- Or click on “Steps” under properties and choose “Command”
- After you click on “Command” add a “Step Title”. Then click on “Insert Batch File…”
- Choose the batch file in the saved location from step 6.
- After clicking on the batch file, click “Open”
- Under “Details” add the codes 0,1641,3010 in “Success Codes”
Definitions of Success Codes: The Microsoft Installer (.msi) generates return codes (AKA error codes) when a .msi file completes. There are three (3) return codes that are automatically marked as a Success:
- Click the “Conditions” tab. Then click the drop arrow on the O/S Version to choose the targeted OS versions.
- Next, choose “Options” and from the “Run As” choose “Deploy User (Interactive).
- You can now use PDQ Deploy to run the uninstall script.
About the Author
Follow on Linkedin More Content by Ken Williams