China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-23 05:26
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Batch scripts that can run in minimized mode View 11,522 Replies 28
Floor 16 Posted 2007-01-20 09:18 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
Originally posted by tghksj at 2007-1-18 08:52:
Teacher HUNRYBECKY

It's a bit difficult to access the address you provided via the telecom network. Please attach one, thank you:)



Not really a teacher, you can join my group. It's inside, the group number is: 29946542
Floor 17 Posted 2007-01-20 09:23 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
It must be like that. It's impossible to be completely hidden
Floor 18 Posted 2007-01-20 09:54 ·  中国 天津 电信
初级用户
Credits 97
Posts 43
Joined 2005-07-25 22:07
20-year member
UID 41055
Status Offline
Originally posted by everest79 at 2007-1-20 08:31:
When you double-click to execute, this batch file will only execute the following code

@echo off&&mode con cols=15 lines=1
%1 %2
start /min /i "" "%~nx0" goto min&&goto :eof

...


Still don't understand. After I add a reference to an external command, and then close it, two identical windows appear. Please tell me: If I add a
call QQ.exe

Where should I add it? Thanks!
Floor 19 Posted 2007-01-20 10:22 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
@echo off&&mode con cols=15 lines=1
%1 %2
start /min /i "" "%~nx0" goto min&&goto :eof

:min
start "" "qq.exe"
exit
Floor 20 Posted 2007-01-20 12:06 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Originally posted by HUNRYBECKY at 2007-1-19 20:14:

The one imitated is not the real hiding, and the effect is not good.

My title is: Batch file that can run in minimized state
Not: Batch file that can run in hidden state

Many times, only the requirement is that the batch file runs in minimized state, not hidden state

[ Last edited by zh159 on 2007-1-19 at 11:08 PM ]
Floor 21 Posted 2007-01-20 21:01 ·  中国 天津 电信
初级用户
Credits 97
Posts 43
Joined 2005-07-25 22:07
20-year member
UID 41055
Status Offline
Hello, two experts, please help me see how to apply your code to my situation.
http://www.cn-dos.net/forum/viewthread.php?tid=26896&fpage=1
Floor 22 Posted 2007-06-07 13:47 ·  中国 广东 佛山 电信
高级用户
★★
我思故我在
Credits 512
Posts 228
Joined 2007-01-21 10:31
19-year member
UID 77225
Gender Male
Status Offline
Learning
我确实是只菜鸟,而且这里X人太多,所以我不敢装X。谁要再说我装X,我就XXOO他。
Floor 23 Posted 2007-06-08 12:51 ·  中国 广东 佛山 电信
高级用户
★★
我思故我在
Credits 512
Posts 228
Joined 2007-01-21 10:31
19-year member
UID 77225
Gender Male
Status Offline
If only minimize is required, then

@echo off
start %0 /min

Isn't this very concise?
我确实是只菜鸟,而且这里X人太多,所以我不敢装X。谁要再说我装X,我就XXOO他。
Floor 24 Posted 2007-06-08 16:36 ·  中国 江苏 连云港 电信
高级用户
★★★
前进者
Credits 641
Posts 303
Joined 2007-01-10 02:57
19-year member
UID 76009
Gender Male
Status Offline
I want to ask one thing, why use %1 and %2? I don't understand. Can someone help explain it, please?
我相信总有一天,总会遇到一个人可以相濡以沫、相吻以湿!
Floor 25 Posted 2007-06-08 17:09 ·  中国 广东 广州 电信
高级用户
★★★
潜水修练批处理
Credits 788
Posts 366
Joined 2006-12-31 02:43
19-year member
UID 75048
Gender Male
Status Offline
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
RaterScoreTime
oilio +3 2007-06-08 18:48
qinbuer +2 2007-06-09 02:14
26933062 +4 2007-06-12 14:14
正在潜水修练的批处理小白
Floor 26 Posted 2007-06-08 18:48 ·  中国 江苏 连云港 电信
高级用户
★★★
前进者
Credits 641
Posts 303
Joined 2007-01-10 02:57
19-year member
UID 76009
Gender Male
Status Offline
Thanks to the friend above for the explanation, I'll study it when I get off work and go home.
我相信总有一天,总会遇到一个人可以相濡以沫、相吻以湿!
Floor 27 Posted 2007-06-09 21:10 ·  中国 广东 深圳 电信
初级用户
★★
Credits 167
Posts 95
Joined 2007-05-06 09:19
19-year member
UID 87628
Gender Male
Status Offline
None
Floor 28 Posted 2009-06-15 16:12 ·  中国 广东 佛山 联通
初级用户
Credits 38
Posts 20
Joined 2008-04-11 12:01
18-year member
UID 115584
Gender Male
Status Offline
start /min /i "" "%~nx0" goto min
===============
I want to ask, if I add some meaningless characters in front of "goto min", it will go wrong and repeatedly run itself.
Can only "goto min" follow after start?
Because I just wanted to try whether I can call out %1, %2, %3 and so on...

It seems that digging up old posts is not right, and starting a new post wastes resources... Moderator大人has a lot
Floor 29 Posted 2010-04-11 19:10 ·  中国 广东 广州 电信
初级用户
★★
Credits 89
Posts 76
Joined 2009-12-13 13:41
16-year member
UID 156499
Gender Male
Status Offline
I also can't understand here of %1 and %2?

Who can tell me?
Forum Jump: