@@ -32,8 +32,7 @@ static void Main(string[] _)
3232 if ( LogUtils . LogFileExists ( PATH_LOGFILE ) )
3333 {
3434 _isReady = true ;
35- IntPtr winHandle = Process . GetCurrentProcess ( ) . MainWindowHandle ;
36- ShowWindow ( winHandle , SW_SHOWMINIMIZED ) ;
35+ Minimize ( ) ;
3736 }
3837 else {
3938 Utils . PrintInfo ( "\n ========================" ) ;
@@ -43,8 +42,9 @@ static void Main(string[] _)
4342 Utils . Print ( $ "\n When it runs it will in turn run all { FILE_PATTERN } files in the { PATH_STARTFOLDER } folder.") ;
4443 Utils . Print ( $ "\n If there are { FILE_PATTERN } files in { PATH_STOPFOLDER } it will stay and run those on shutdown.") ;
4544 Utils . Print ( "\n This message is only shown once, to see it again delete the log file." ) ;
46- Utils . Print ( "\n Press [Enter] in this window to continue execution." ) ;
45+ Utils . Print ( "\n Press [Enter] in this window to continue execution.\n If there are shutdown scripts the window will remain in the task bar. " ) ;
4746 Console . ReadLine ( ) ;
47+ Minimize ( ) ;
4848 _isReady = true ;
4949 }
5050
@@ -54,6 +54,11 @@ static void Main(string[] _)
5454 OpenVR . Shutdown ( ) ;
5555 }
5656
57+ private static void Minimize ( ) {
58+ IntPtr winHandle = Process . GetCurrentProcess ( ) . MainWindowHandle ;
59+ ShowWindow ( winHandle , SW_SHOWMINIMIZED ) ;
60+ }
61+
5762 private static bool _isConnected = false ;
5863
5964 private static void Worker ( )
@@ -124,7 +129,7 @@ private static void RunScripts(string folder) {
124129 LogUtils . WriteLineToCache ( $ "Found: { files . Length } script(s) in { folder } ") ;
125130 foreach ( var file in files )
126131 {
127- LogUtils . WriteLineToCache ( $ "Executing: { file } from { folder } ") ;
132+ LogUtils . WriteLineToCache ( $ "Executing: { file } ") ;
128133 var path = Path . Combine ( Environment . CurrentDirectory , file ) ;
129134 Process p = new Process ( ) ;
130135 p . StartInfo . CreateNoWindow = true ;
@@ -133,7 +138,7 @@ private static void RunScripts(string folder) {
133138 p . StartInfo . Arguments = $ "/C \" { path } \" ";
134139 p . Start ( ) ;
135140 }
136- if ( files . Length == 0 ) LogUtils . WriteLineToCache ( $ "Did not find any .cmd files to execute in { folder } ") ;
141+ if ( files . Length == 0 ) LogUtils . WriteLineToCache ( $ "Did not find any { FILE_PATTERN } files to execute in { folder } ") ;
137142 }
138143 catch ( Exception e )
139144 {
@@ -143,6 +148,7 @@ private static void RunScripts(string folder) {
143148
144149 private static void WaitForQuit ( )
145150 {
151+ Utils . Print ( "This window remains to wait for the shutdown of SteamVR to run additional scripts on exit." ) ;
146152 var shouldRun = true ;
147153 while ( shouldRun )
148154 {
0 commit comments