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-20 08:03
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to automatically close the command line window View 15,874 Replies 40
Floor 31 Posted 2006-07-21 16:11 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
Originally posted by zxcv at 2006-7-21 15:46:

But only a part of those that are correctly installed and registered in the registry will work. I tried normal installations, and AutoCAD works.


Yes, most of the installed software can be started, especially those from foreign or large software companies. Simply list a few common ones:
start realplay
start ACDSee7
start mplayerc
start winrar
start kav
start QuickTimePlayer
start nero
start uedit32
start Office series....
start Microsoft all components....
Chat tools like QQ don't work

[ Last edited by fastslz on 2006-7-21 at 16:12 ]
Floor 32 Posted 2006-07-21 16:30 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
The key point is: It needs to be installed in the normal installation method and then registered in the registry.
Floor 33 Posted 2006-09-04 06:52 ·  中国 上海 黄浦区 电信
新手上路
Credits 18
Posts 7
Joined 2006-09-01 08:31
19-year member
UID 61668
Status Offline
Floor 34 Posted 2006-09-04 07:30 ·  中国 四川 绵阳 电信
高级用户
★★
Credits 587
Posts 282
Joined 2006-04-10 03:40
20-year member
UID 53599
Gender Male
Status Offline
Use shortcuts ^.^
Floor 35 Posted 2006-12-29 10:05 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
Originally posted by namejm at 2006-7-21 15:33:
  "Can we ignore the path for installed software"? Fastslz, are you kidding? Anyway, I put the bat file on the desktop and then start to install a program in another partition, and it never succeeded...



Moderator namejm, in fact, start can indeed ignore many paths, and can also start a certain directory, such as
start system32 will directly open the system32 directory of WINDOWS.

Regarding the paths that START can ignore, they can be set in the registry. All commands that can ignore paths in the registry are stored in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths. You can even directly use BAT to add programs that need to ignore paths. For example, I add a program MSACCESS.EXE that can start ACCESS 2000 RUNTIME. In order to avoid conflict with the original MSACESS.EXE program, I change it so that you can enter START ACCESS2K.EXE in the command to start the application


ECHO HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ACCESS2K.EXE] >TMP.REG
ECHO @="D:\\Access2KRT\\Office\\MSACCESS.EXE">>TMP.REG
ECHO "Path"="D:\\Access2KRT\\Office\\">>TMP.REG
ECHO "useURL"="1>>TMP.REG
REGEDIT /S TMP.REG
DEL TMP.REG /Q/F
Floor 36 Posted 2006-12-29 11:59 ·  中国 北京 中国科学院研究生院
银牌会员
★★★
Credits 1,187
Posts 555
Joined 2006-12-21 07:35
19-year member
UID 74129
Gender Male
Status Offline

@echo off
cd "Path of the program to run"
start /min Name
exit


For example:
Path is d:\program files\
Name is wmplayer.exe

Remember to add double quotes


[ Last edited by scriptor on 2006-12-28 at 11:21 PM ]
Floor 37 Posted 2006-12-29 12:31
中级用户
★★
DOS之日
Credits 337
Posts 161
Joined 2006-11-04 05:27
19-year member
UID 69523
Gender Male
Status Offline
Using %PATH% to find files is indeed good. Hehe, you can also use this way to find the execution file's path.


@echo off
SET PH=%ProgramFiles%\Adobe\Acrobat 7.0\Reader\
FOR %%I IN (AcroRd32.exe) DO start "" "%%~$PH:I"
exit


In PH, you can use ; to separate multiple paths like PATH.
for /f %%h in (`echo hxuan`) do for /f %%x in (`echo hxuan`) do if %%h==%%x nul
Floor 38 Posted 2006-12-29 12:37
中级用户
★★
DOS之日
Credits 337
Posts 161
Joined 2006-11-04 05:27
19-year member
UID 69523
Gender Male
Status Offline
Also, I just thought of two questions that no one answered, so I'll answer them, heh.
1, Why can using START automatically close the CMD window.
2, Why must use start "Title of AcroRd32.exe" "D:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" to execute.

The first is because, if it's an internal CMD command or a batch file, by default it runs with CMD /K, and /K means run the program and keep the window.
The second is because, the path in quotes is recognized as the title string, so there's no path, and thus an error occurs. If you write it as,

start "D:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" AA

then it will prompt you that file AA is not found.

[ Last edited by hxuan999 on 2006-12-29 at 07:53 PM ]
for /f %%h in (`echo hxuan`) do for /f %%x in (`echo hxuan`) do if %%h==%%x nul
Floor 39 Posted 2006-12-31 07:25
中级用户
★★
DOS之日
Credits 337
Posts 161
Joined 2006-11-04 05:27
19-year member
UID 69523
Gender Male
Status Offline
for /f %%h in (`echo hxuan`) do for /f %%x in (`echo hxuan`) do if %%h==%%x nul
Floor 40 Posted 2007-03-23 05:51 ·  中国 广东 深圳 电信
初级用户
Credits 59
Posts 28
Joined 2007-03-23 05:18
19-year member
UID 82622
Gender Male
Status Offline
There are too many people in the alliance! It's not that I'm stupid!
Floor 41 Posted 2007-06-29 02:43 ·  中国 湖北 十堰 郧西县 联通
初级用户
Credits 38
Posts 20
Joined 2006-07-04 16:50
19-year member
UID 58001
Status Offline
Start classic issues, all have encountered.
Forum Jump: