Uninstalling Autodesk Software with the WMIC Utility


It’s not uncommon to have two or three versions of ten or more Autodesk products installed on a typical workstation. Each one of those products having language packs, libraries, enablers, add-ons etc. This can result in dozens of installed Autodesk applications. Even uninstalling one release year of those products, done manually could mean running through thirty or more uninstallation wizards. This blog post, updated from one I did back in 2013, will guide you through making this process much easier, faster, and less work.

WMIC Uninstall
The most versatile way to uninstall is by using the WMI command-line (WMIC) utility. (Windows Management Instrumentation Command) This utility can be used for a wide variety of tasks, one of which, is uninstalling applications using the CALL command. This command can be customized to uninstall any selection of applications by searching based on two types of criteria; Vendor, and Name. To select Autodesk applications, you can make a call for any applications that have the vendor ‘Autodesk’. Since every Autodesk application has that in common, it’s a great way to select all Autodesk apps. Some Autodesk applications list the vendor as ‘Autodesk’, and some ‘Autodesk, Inc.’. By searching with ‘Autodesk%’, the ‘%’ will grab both variations of the vendor name. You can then use other search terms to narrow down what you want to select, like a product year in the application name. For example, the Vendor ‘Autodesk%’, and ‘%2018%’ in the product name, would get all Autodesk applications with 2018 in the name. Like in the vendor name search, the ‘%’ on either side of the year is a wildcard, telling the search to find anything with 2018 in the name, regardless of any characters to the left, or right of it.
CMD run as Administrator in WMIC Uninstall
 I will show you the syntax for three of the most common scenarios. Uninstalling ALL Autodesk applications, All from a particular release year, or from multiple release years. You can modify these to fit your exact needs.
To get started, you need to first open CMD with elevated permissions. (You can also use PowerShell if you prefer) To open CMD, click the Start button, and type ‘CMD’ you will see the command prompt in the list of applications, right click on it and select ‘Run as Administrator’. If you do not run CMD elevated (run as administrator), you may get an error when it begins uninstalling.

In the Command prompt, type ‘WMIC’ and hit enter. This will start up the WMIC utility. From here, simply enter the syntax for the command you want to run and hit enter to run it. As is the case with any utility, syntax is very important. Be sure you don’t miss any spaces, quotations etc in your command.  I typically use the /nointeractive switch, to make the uninstall process happen unattended.
If you are pre-writing your commands, do so in notepad or equivalent text editor, not MS Word, or other word processor. This is because of how each app type handles punctuation; apostrophe, vs single quote. The syntax requires a single quote { ' } which text editors will use. The command will fail if you write the command in a word processor, that will use an apostrophe { ‘ }. They look very similar, but are handled differently by CMD, be sure to use the correct one, the single quote.  
In the list of commands below, don’t include the brackets, { }, at the beginning and end, they are just to encapsulate the command. 
Uninstall All Autodesk Applications:
{ product where "vendor like 'autodesk%'" call uninstall /nointeractive }
Uninstall 2017 Autodesk Applications:
{ product where "vendor like 'autodesk%' and name like '%2017%'" call uninstall /nointeractive }
Uninstall 2017, and 2018 Autodesk Applications:
{ product where "(name like '%2017%' or name like '%2018%') and (vendor like 'autodesk%')" call uninstall /nointeractive }

Administrator Command Prompt in WMIC Uninstall from Autodesk

The WMIC call can be made on your local machine, a remote machine, or a list of remote machines.  The above commands will run on your computer.
To uninstall on a remote computer, prefix the command with { /node:computername } where ‘computername’ is the hostname of the remote computer. For example: { /node:computername product where "vendor like 'autodesk%'" call uninstall /nointeractive  }
To uninstall from a list of remote computers, create a text file and save it to your local machine. For this example, I named it ‘pc.txt’ saved at C:\removal The text file will contain the hostnames of the computers you want to uninstall from, one hostname per line. No commas or semi colons, just hostnames, each on their own line. Prefix the uninstall command with { /failfast:on /node:@"c:\pc.txt" } For Example: { /failfast:on /node:@"c:\removal\pc.txt" product where "vendor like 'autodesk%'" call uninstall /nointeractive  }
As each application uninstalls, you should get a return value of ‘0’. This means it successfully uninstalled. If you are getting a return value of 1603; check to make sure that you ran CMD elevated (Run as Administrator)

- Bryson Anderson

Comments