If you’re trying to run compmgmt.msc (Computer Management) or any other MMC snap-in via the runas command, you might’ve seen
Error 193: compmgmt.msc is not a valid Win32 application. This is simply due to some complications with the runas command. If you just type
runas, it’ll open successfully. The reason is some complications with the runas command.
Luckily there’s an easy solution. Since compmgmt.msc is not a regular win32 (or a typical exe) application, you have to prepend “mmc” in order to tell Microsoft that you’re trying to run a Microsoft Management Console snap-in.
runas /user:domain\username "mmc compmgmt.msc"
This is also the case for every other *.msc snap-in, such as
I’ve mentioned this briefly in an earlier post as well: