I have a batch file that does a runas and automatically enters the password:
@if (@CodeSection == @Batch) @then
@echo off
start "" runas /noprofile /user:myuser cmd
CScript //nologo //E:JScript "%~F0"
goto :EOF
@end
WScript.CreateObject("WScript.Shell").SendKeys("password{ENTER}");`
(source: Automatically respond to runas from batch file)
I would like to execute commands in the new window that opens as a result of the "runas" command. Does anyone know how I might go about doing this? Thanks.