Sorry, but I'm absolutely certain that it's impossible (through the command prompt) to start a command prompt as another user
and with elevated privileges, because
there is no such command line command that allows one to start a new process as elevated using credentials other than the builtin Administrator at least, and the Runas command does not accept multiple user credentials.
The question posed by the OP
cannot be achieved via the Command Prompt. What else can we try then? Let's take a look at Windows
Powershell instead...
Powershell is the future scripting language and command line interface for Windows. It is much more robust than the Command Prompt which uses different parsing tools to process each unique command and Powershell is more flexable with a larger set of built-in commands and only one command parser for all of them. Anyone from Windows XP and later may use it.
The following powershell command, in theory,
should start a command prompt instance running as the user "User01", while at the same time run as an elevated process:
Code:
Start-Process cmd -Credential User01 -Verb RunAs
... but in practise, this raises an exception.
It seems that the switches '-Credential' (specify a user to run as) and '-Verb' ((potentially) specify that the executable should run elevated) cannot be used together; it's as if
Microsoft never wanted users to be able to start processes as other users and run the process as administrator at the same time, anyhow.
But with a dab of tricky involved, there is a well known powershell command going around that does exactly what you need, Jonnyhotchkiss and Lea Massiot, here it is (this is a slimed down version of the same command you might find elsewhere on the internet):
Code:
Start-Process powershell 'Start-Process cmd -Verb RunAs' -Credential User01
(Replacing "User01" with the user to run as (and "cmd" with the program of your choice) as needed)
It works by calling a new instance of Powershell as a specified user (User01 in this case), then it executes another Start-Process command (aka Cmdlet) inside the new Powershell instance which invokes cmd.exe with 'Run as Administrator' privileges. So it's as if that other user had typed out that second command (
Start-Process cmd -Verb RunAs) into a Powershell prompt.
The above powershell command is one of the very few ways in Windows to start a new process as another user, while at the same time running it with administrative (elevated) permissions. All done in one go.
I'm sorry that the solution could not involve simple commands typed at the command prompt. If it was possible I would share, but Powershell is the only way to go here.