forked from uk-dave/SolidEdge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunKeyShotRemoteDesktop.cmd
More file actions
102 lines (89 loc) · 3.58 KB
/
RunKeyShotRemoteDesktop.cmd
File metadata and controls
102 lines (89 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
@echo off
rem RunKeyShotRemoteDesktop.cmd
rem Copyright (C) 2019, David C. Merritt, david.c.merritt@siemens.com
rem
rem This program is free software: you can redistribute it and/or modify
rem it under the terms of the GNU General Public License as published by
rem the Free Software Foundation, either version 3 of the License, or
rem (at your option) any later version.
rem
rem This program is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
rem GNU General Public License for more details.
rem
rem You should have received a copy of the GNU General Public License
rem along with this program. If not, see <http://www.gnu.org/licenses/>.
rem
rem ---------------------------------------------------------------------
rem
rem Batch script to run KeyShot in a remote dekstop session.
rem
rem ------------------
rem *** TO INSTALL ***
rem ------------------
rem
rem 1. Copy this script on to the remote workstation which has KeyShot
rem installed to it.
rem
rem 2. Edit this script where indicated to define the full path to the
rem KeyShot exe file
rem
rem --------------
rem *** TO USE ***
rem --------------
rem
rem 1. Remote desktop in to the workstation with KeyShot installed to it
rem
rem 2. Run this script that we have previously coped ot the remote
rem workstation
rem
rem 3. The script will disconnect the active remote desktop session but
rem leave the user logged in on the remote workstation
rem
rem 4. The script will then launch the KeyShot exe on the remote but now
rem disconnected session
rem
rem 5. After a few seconds of being disconnected, allowing some time for
rem KeyShot to fully launch, then remote desktop back into the
rem workstation
rem
rem Voilà! KeyShot is now running remotely.
rem
rem
rem ---------------------------------------------------------------------
rem
rem 30/04/2019 merritt initial release
rem 01/05/2019 merritt added title to window
rem
rem *******************************************************************
rem Define the full command line to run the KeyShot exe file below here
rem *******************************************************************
set ProgramCmdLine="C:\Program Files\KeyShot7\bin\keyshot.exe"
rem *******************************************************************
rem Define the full command line to run the KeyShot exe file above here
rem *******************************************************************
rem set the window title
title Start KeyShot from RDC
rem set command line for tasklist.exe used to help identify our current desktop session id
set IdentifySessionIdCmd=tasklist /FI "IMAGENAME eq tasklist.exe" /FO "TABLE" /NH
rem run tasklist.exe and capture the remote session id from the output
for /f "tokens=4 delims= " %%i in ('%IdentifySessionIdCmd%') do set SessionId=%%i
rem forewarn the user of disconnect and pause so user can aknowledge this
echo.
echo We are about to connect back to the remote system display.
echo This will automatically disconnect your Remote Desktop session.
echo This is expected and is no cause for alarm.
echo Please allow time for KeyShot to fully launch on the remote system.
echo Then reconnect your Remote Desktop session and use KeyShot.
echo.
pause
rem connect our remote session back to the running desktop console
tscon %SessionId% /dest:console
rem now we are disconnected launch KeyShot
start "" %ProgramCmdLine%
rem be a good citizen and clean up after ourselves and exit quietly
set ProgramCmdLine=
set IdentifySessionIdCmd=
set SessionId=
exit /b