Page 1 of 1
Minimizing batch code, seemingly not working
Posted: Dec 20th, ’19, 15:16
by Oblomov
Hello,
I tend to use
Code: Select all
if not DEFINED IS_MINIMIZED set IS_MINIMIZED=1 && start "" /min "%~dpnx0" %* && exit
'batch code here'
exit
For instantly minimizing batch files, upon use. However, when evoked from FK, it seems to not work, i.e. not get minimized. This would usually not matter much in my case, as I use ZMover, however, it is rather dysfunctional, when it concerns CMD windows... so yeah, is this perhaps some sort of a limitation of sorts?
Use batch files very frequently, so a bit of a bummer, I guess
Re: Minimizing batch code, seemingly not working
Posted: Feb 18th, ’20, 19:55
by Oblomov
Perhaps some sort of a hide attribute can be used like in
https://www.autohotkey.com/boards/viewtopic.php?t=20314
?
Re: Minimizing batch code, seemingly not working
Posted: Feb 18th, ’20, 23:46
by Tom
I'm not sure I understand. Can you post FastKeys command which does not work?
Re: Minimizing batch code, seemingly not working
Posted: Feb 19th, ’20, 21:15
by Oblomov
Tom wrote: ↑Feb 18th, ’20, 23:46
I'm not sure I understand. Can you post FastKeys command which does not work?
Sure,
I have a 'Run' command with the following content:
"C:\Users\Test\Dropbox\Offset restart 1.bat"
If I run the batch file manually, the CMD that opens upon execution, is auto-hidden due to:
Code: Select all
if not DEFINED IS_MINIMIZED set IS_MINIMIZED=1 && start "" /min "%~dpnx0" %* && exit
(Program initiation or whatever else here)
exit
However whenever I execute the .bat through FK, it doesn't become auto-hidden
Re: Minimizing batch code, seemingly not working
Posted: Feb 19th, ’20, 21:53
by Tom
Try Type: Command
Code: Select all
Run, C:\Users\Leon\Dropbox\Offset restart 1.bat,, Hide
Check the full syntax here:
https://www.autohotkey.com/docs/commands/Run.htm
Re: Minimizing batch code, seemingly not working
Posted: Feb 19th, ’20, 21:56
by Oblomov