launching .msc files with psexec
ever try to launch a .msc w/ psexec? it’s a frustrating experience unless you know how. i found myself in this predicament a number of times but wasn’t interested in figuring out at the time since there were many other easier ways to get around it.
can’t let this one slip away. i will certainly need this later. as usual, let’s start with the wrong way.
c:\>psexec -u <domain>\<user> -p <password> dsa.msc PsExec v1.94 - Execute processes remotely Copyright (C) 2001-2008 Mark Russinovich Sysinternals - www.sysinternals.com PsExec could not start dsa.msc: %1 is not a valid Win32 application.
how about this way?
c:\>psexec -u <domain>\<user> -p <password> mmc.exe dsa.msc PsExec v1.94 - Execute processes remotely Copyright (C) 2001-2008 Mark Russinovich Sysinternals - www.sysinternals.com PsExec could not start mmc.exe dsa.msc: The parameter is incorrect.
the one above, you may or may not see depending on how your paths are setup. the real secret is getting the mmc.exe to call dsa.msc. to prevent any odd path problems from getting in the way, this is the way we should execute it. by the way, i added –d so that we don’t keep the cmd shell in a holding pattern.
c:\>psexec -d -u <domain>\<user> -p <password> %windir%\system32\mmc.exe dsa.msc
PsExec v1.94 - Execute processes remotely
Copyright (C) 2001-2008 Mark Russinovich
Sysinternals - www.sysinternals.com
mmc.exe started with process ID <1234>
if you’re logged in via a RDP connection to a server, make sure you’re not running into problems with the console view. i blogged about this awhile back in this entry.
glad i found your posting on this. Was about to give up. great tip thanks!
ReplyDeleteglad i found your posting on this. Was about to give up. great tip thanks!
ReplyDeleteMany thanks for this. 12+ years later this is still a valid and useful tip. Thanks.
ReplyDelete