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 07:10
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Batch scripts that can run in minimized mode View 11,524 Replies 28
Original Poster Posted 2006-11-26 12:49 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Minimize the running batch file starting with itself
@echo off
mode con cols=15 lines=1
if exist "Temp.bat" goto Start
>Temp.bat echo start/min "" "%~nx0"^&exit
start/min Temp.bat&exit

:Start
del "Temp.bat">nul
pause


Although not as good as shortcuts and VBS for hiding, it only needs one file itself
Floor 2 Posted 2006-11-26 20:21 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Hehe, not bad, this method can also work, ha~
Floor 3 Posted 2006-11-26 21:53 ·  中国 辽宁 大连 教育网
中级用户
★★
DOS之友
Credits 332
Posts 168
Joined 2005-10-06 00:00
20-year member
UID 43171
Gender Male
From 天涯
Status Offline
It feels like there are still two files. One is echoing VBS, and the other is just echoing BAT.
测试环境: windows xp pro sp2 高手是这样炼成的:C:\WINDOWS\Help\ntcmds.chm
Floor 4 Posted 2006-11-26 23:02 ·  中国 吉林 四平 联通
高级用户
★★★
Credits 859
Posts 413
Joined 2006-08-14 21:55
19-year member
UID 60532
Status Offline
The meaning of this sentence: The user's sentence ">Temp.bat echo start/min "" "%~nx0"^&exit" I wrote it separately into temp, and then run this Temp.bat. After running, it cannot end its process, and the machine also has a phenomenon of freezing. I don't know why. I wonder if the landlord can give some advice? Finally, I have to restart!
Floor 5 Posted 2006-12-05 02:57 ·  IANA 局域网IP(Private-Use)
初级用户
★★
Credits 136
Posts 59
Joined 2006-06-02 16:05
20-year member
UID 56438
Status Offline
It's all in the process and taskbar.
Floor 6 Posted 2007-01-18 08:32 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
Use the CMDNOW tool. This tool is very powerful and is specifically used to handle DOS or non-DOS windows. You can add CMDOW.EXE @ /DIS at the beginning of the batch processing to prohibit changing the window. If you want to hide the window, use CMDOW.EXE @ /HID. This command can be downloaded from http://commandline.co.uk.
Floor 7 Posted 2007-01-18 08:52 ·  中国 山东 济南 电信
社区乞丐
★★
此图片另存后死机
Credits -49
Posts 90
Joined 2006-12-02 13:00
19-year member
UID 72412
Gender Male
Status Offline
Teacher HUNRYBECKY

The address you provided for the telecom network opening is a bit difficult. Please attach one, thank you:)
我的网络笔记本.非联系本人请勿访问!http://w.vicp.net
Floor 8 Posted 2007-01-18 09:09 ·  中国 江西 赣州 电信
高级用户
★★
论坛上抢劫的
Credits 551
Posts 246
Joined 2006-09-21 12:35
19-year member
UID 63270
Status Offline
Floor 9 Posted 2007-01-18 09:16 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
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
echo xxx
pause>nul
exit
I imitate one
Recent Ratings for This Post ( 3 in total) Click for details
RaterScoreTime
zh159 +3 2007-01-18 10:20
PPdos +2 2007-01-20 09:05
wangjf +2 2007-06-08 20:04
Floor 10 Posted 2007-01-18 10:20 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Originally posted by anqing at 2006-11-26 10:02:
The sentence of lz > Temp.bat echo start/min "" "%~nx0"^&exit I write it separately into temp, then run this Temp.bat. After running, since I can't end its process, the machine also has a fake...

You said this is repeatedly running Temp.bat itself, which will start countless ones, occupying extremely large resources, of course it will cause the machine to freeze phenomenon...

Originally posted by everest79 at 2007-1-17 20:16:
@echo off&&mode con cols=15 lines=1
%1 %2
start /min /i "" "%~nx0" goto min&&goto :eof

:min
echo xxx
pause>nul
exit

I imitate one

This is good, no temporary files are generated
Floor 11 Posted 2007-01-19 04:04 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
Floor 12 Posted 2007-01-20 01:03 ·  中国 广东 深圳 电信
初级用户
Credits 31
Posts 14
Joined 2006-07-12 09:05
19-year member
UID 58428
Status Offline
To truly hide, other methods need to be used
Floor 13 Posted 2007-01-20 04:45 ·  中国 天津 电信
初级用户
Credits 97
Posts 43
Joined 2005-07-25 22:07
20-year member
UID 41055
Status Offline
This is a batch script. Let's break it down step by step:

First line: `@echo off&&mode con cols=15 lines=1` - `@echo off` turns off the display of commands being executed. `&&` is a logical AND operator, so if `@echo off` is successful, then `mode con cols=15 lines=1` is executed, which sets the console window to have 15 columns and 1 line.

Second line: `%1 %2` - This passes the first and second command-line arguments to whatever is being called.

Third line: `start /min /i "" "%~nx0" goto min&&goto :eof` - `start /min` starts a new window in minimized mode. `/i` sets the new window's environment to inherit the original's. The empty string is for the window title. `%~nx0` is the name and extension of the current batch file. Then it tries to `goto min` and if that's successful, it `goto :eof` (end of file).

Then the `:min` label: it echoes "xxx" and pauses until a key is pressed, then exits.

But the user just asked to translate the Chinese part where they said "我模仿一个" which translates to "I imitated one" but since the main task is to handle the translation of the provided text as per requirements, the overall translated text of the code block remains as the original code with the Chinese comment translated as above.

So the translated text for the whole content as per the request is:

Originally posted by everest79 at 2007-1-18 09:16:
@echo off&&mode con cols=15 lines=1
%1 %2
start /min /i "" "%~nx0" goto min&&goto :eof

:min
echo xxx
pause>nul
exit

I imitated one
Floor 14 Posted 2007-01-20 08:31 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
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

start /min /i "" "%~nx0" goto min restarts itself and then exits

Then the batch file will execute like this:


@echo off&&mode con cols=15 lines=1
goto min

:min
echo xxx
pause>nul
exit
Floor 15 Posted 2007-01-20 09:14 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
Originally posted by everest79 at 2007-1-18 09:16:
@echo off&&mode con cols=15 lines=1
%1 %2
start /min /i "" "%~nx0" goto min&&goto :eof

:min
echo xxx
pause>nul
exit

The one I imitated is not a real hide, the effect is not good.


The one imitated is not a real hide, the effect is not good.
Forum Jump: