I have the following scenario: I have a script (running on a Linux computer, but that's not very important) that logs on via RDP to multiple Windows 10 machines, brings up an elevated CMD window and types commands in it. Until now, the script was doing it by simulating Windows+X keypress to bring up the menu that appears when right-clicking on Start button, and then pressing "A" for "Command Prompt (Admin)" option (then of course normal UAC window appears, which the script can accept). However, in recent versions of Windows 10 this menu has been changed, and command prompt has been replaced by Powershell. Pressing A now brings up Powershell in admin mode, which is not quite what I want. This can be probably reconfigured, but the script is logging on to multiple machines that I have no direct control over and their configuration should not be changed (these are testbed systems), so reconfiguring this is out of question.
Is there any command or key combination that the script can use to open an elevated CMD window, right from the desktop, Start menu or anything? Just typing cmd
and Enter after bringing up the Start menu opens a "normal", non-elevated CMD. Of course if you do it manually, instead of pressing Enter you can after typing cmd
mouse over to the found application, right-click and select "Run as administrator", but the script won't be able to identify the mouse position it should move to - keyboard typing is much more reliable.
I want to repeat that I'm looking for something that is available by default - reconfiguring the target machines is out of question. Also, the only way to access the machines is RDP - they are configured so that WMI etc. is not available.