When I execute the following code:
$creds = Get-Credential -UserName other -Message none # answering the creds dialogue with correct password here Start-Process C:\Windows\system32\cmd.exe -Credential $creds
cmd windows opens (looks completely normal and I can change settings...) but I cannot type anything into the window. Independent of whether it is a normal user or an admin account and the powershell itself is run as normal user or as admin. Except when the Powershell is run as System (via Sysinternal's
psexec): then I get the following error:
Start-Process : This command cannot be run due to the error: Access denied At line:1 char:1 + Start-Process C:\Windows\system32\cmd.exe -Credential $creds + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
I combined this with
powershell instead of the whole cmd-path and added the
-NoNewWindow parameter but nothing of that makes a difference (opens a new window despite the
-NoNewWindow). When runnnig "normal" programs like
notepad everything works as expected - also when I run e.g.
runas /user:other cmd. I currently only have Windows [Version 10.0.17134.165] to test and I am not sure if this is the same on other versions but I think it is Windows 10 specific (?).
Another killjoy flaw in Powershell or am I missing something?