Created
July 13, 2019 03:33
-
-
Save ArthurYidi/9756aa08fcd960c2683cf88af4670a4e to your computer and use it in GitHub Desktop.
remote
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
echo. | |
echo Remote Desktop will be temporarily disconnected . . . please reconnect after a few seconds. | |
echo. | |
pause | |
@echo on | |
REM The active session has an arrow as the first character | |
setlocal EnableDelayedExpansion | |
FOR /F %%A in ('qwinsta') do ( | |
set tempSessionName=%%A | |
if "!tempSessionName:~0,1!"==">" ( | |
@echo on | |
tscon.exe !tempSessionName:~1! /v /dest:console | |
@echo off | |
) | |
) | |
@echo off | |
echo. | |
echo Starting MyProgram.exe . . . | |
@echo on | |
start MyProgram.exe | |
@echo off | |
echo. | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wonderful, thank you!
Any idea how to run this similarly without requiring admin privileges?