diff --git a/rdpusers.cmd b/rdpusers.cmd new file mode 100644 index 0000000..eb997be --- /dev/null +++ b/rdpusers.cmd @@ -0,0 +1,35 @@ +@echo off +goto :Start + +-------------------------------------------------- +RDS Shadow Connection + +Positional parameters: + [1] - hostname or address with sessions for connect + +Administrator rights required +-------------------------------------------------- + +:Start + set host=localhost + if "%~1" NEQ "" set host=%~1 + +:Admin_Check + openfiles >nul 2>&1 + if %errorLevel% == 0 ( + set code=0 + ) else ( + set code=5 + cls + echo Restart this as Administrator! + pause + goto :Exit + ) + +:Session_Choice + quser /server:%host% + set /p rid="Enter RDP user ID for connect: " + start "" mstsc /shadow:%rid% /v:%host% /control /noConsentPrompt + +:Exit +exit %code% \ No newline at end of file