I have this bat file and I want to minimize the cmd window when I run it:
@echo off
cd /d C:\leads\ssh
call C:\Ruby192\bin\setrbvars.bat
ruby C:\leads\ssh\put_leads.rb
Basically I want the command window minimized immediately. Any ideas on how to do this?
I don't know if there is a way to minimize a window from a command-prompt once open, but the following article suggests spawning your actual process as a child in a new, pre-minimized window.
http://www.pcreview.co.uk/forums/command-prompt-tool-minimize-command-window-after-starts-t2037434.html
If you type this text in your bat file.
It will immediately minimize as soon as it opens the program. You will only see a brief flash of it and it will disappear.
Another option that works fine for me is to use ConEmu, see http://conemu.github.io/en/ConEmuArgs.html
The only way I know is by creating a Windows shortcut to the batch file and then changing its properties to run minimized by default.
One way to 'minimise' the cmd window is to reduce the size of the console using something like...
You can reduce the COLS to about 18 and the LINES to 1 if you wish. The advantage is that it works under WinPE, 32-bit or 64-bit, and does not require any 3rd party utility.
You can minimize the command prompt on during the run but you'll need two additional scripts: windowMode and getCmdPid.bat: