Minimizing batch code, seemingly not working

Discussion, questions and support.
Post Reply
User avatar
Oblomov
Posts: 107
Joined: Mar 4th, ’19, 19:44

Post by Oblomov » Dec 20th, ’19, 15:16

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
Last edited by Oblomov on Feb 19th, ’20, 07:41, edited 1 time in total.
User avatar
Oblomov
Posts: 107
Joined: Mar 4th, ’19, 19:44

Post by Oblomov » Feb 18th, ’20, 19:55

Perhaps some sort of a hide attribute can be used like in
https://www.autohotkey.com/boards/viewtopic.php?t=20314
?
User avatar
Tom
Posts: 398
Joined: Nov 24th, ’15, 23:39

Post by Tom » Feb 18th, ’20, 23:46

I'm not sure I understand. Can you post FastKeys command which does not work?
User avatar
Oblomov
Posts: 107
Joined: Mar 4th, ’19, 19:44

Post by Oblomov » Feb 19th, ’20, 21:15

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
User avatar
Tom
Posts: 398
Joined: Nov 24th, ’15, 23:39

Post by Tom » Feb 19th, ’20, 21:53

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
User avatar
Oblomov
Posts: 107
Joined: Mar 4th, ’19, 19:44

Post by Oblomov » Feb 19th, ’20, 21:56

Tom wrote:
Feb 19th, ’20, 21:53
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
Will do, thanks! ❤
Post Reply