Originally posted by qinbuer at 2007-6-8 12:51 PM:
If only minimizing is required, then
@echo off
start %0 /min
Isn't this very concise?
First, directly start %0 /min cannot start the original batch processing; it needs to be start "" %0 /min and so on;
Second, /min placed at the back is invalid; placing it at the front start /min "" %0;
Third, directly executing this code will produce a recursive effect, and directly using start to call bat is not cmd /c but cmd /k to execute the batch processing. That is, after the batch processing runs all the code, it will not exit, which will make the cmd window pop up a lot. You can try it, don't say I caused a crash...
To the above:
%1 %2 are the startup parameters passed when the last start called the batch processing:
start /min /i "" "%~nx0" goto min
Here %1 and %2 correspond to goto and min respectively;
Then when the batch processing called by start executes %1 %2, it is equivalent to executing goto min, which jumps to the :min label without executing start again to avoid the recursive effect
Recent Ratings for This Post
( 3 in total)
Click for details
正在潜水修练的批处理小白