想用一个批处理在任意磁盘分区(包括光驱)中的根目录下查找一个BAT.BAT命令并运行它得怎么样写呀
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off
echo %ComSpec% | find /i "cmd.exe" > nul
if errorlevel 1 goto _notnt
goto _nt
:_notnt
set drives=
for %%D in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) DO Call IsReady %%D
::echo %drives%
::pause
set mypath=
for %%D in (%drives%) DO if exist %%D\syssoft\clone\systools\ghost.exe apath *mypath %%D\SYSSOFT\CLONE\SYSTOOLS;%%D\SYSSOFT\CLONE\DOSTOOLS;%%D\SYSSOFT\CLONE\WINTOOLS
if exist c:\ucdos\nul apath c:\ucdos
if exist c:\dos71\nul apath c:\dos71
if exist c:\dos\nul apath c:\dos
if exist c:\batch\nul apath c:\batch
for %%D in (%drives%) DO if exist %%D\systools\pqmagic.exe apath *mypath %%D\SYSTOOLS;%%D\DOSTOOLS;%%D\WINTOOLS
if not "%mypath%"=="" apath %mypath%
if "%mypath%"=="" goto _nopath
echo Add %mypath%
goto _quit
:_nt
set drives=C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:
set mypath=
for %%D in (%drives%) DO if exist %%D\syssoft\clone\systools\ghost.exe set mypath=%mypath%;%%D\SYSSOFT\CLONE\SYSTOOLS;%%D\SYSSOFT\CLONE\DOSTOOLS;%%D\SYSSOFT\CLONE\WINTOOLS
if exist c:\ucdos\. set mypath=%mypath%;c:\ucdos
if exist c:\dos71\. set mypath=%mypath%;c:\dos71
if exist c:\dos\. set mypath=%mypath%;c:\dos
if exist c:\batch\. set mypath=%mypath%;c:\batch
for %%D in (%drives%) DO if exist %%D\systools\pqmagic.exe set mypath=%mypath%;%%D\SYSTOOLS;%%D\DOSTOOLS;%%D\WINTOOLS
if not "%mypath%"=="" goto _ntsetpath
if "%mypath%"=="" goto _nopath
:_ntsetpath
echo %path% | find /i "%mypath%" > nul
if errorlevel 1 set path=%path%;%mypath% && echo Add %mypath%
goto _quit
:_nopath
echo Sorry! I cannot find any xyf's path on your system.
echo PATH NOT SET!!!
pause
:_quit
set drives=
set mypath=
@echo off
dready %1 > nul
if errorlevel 1 goto _quit
if errorlevel 0 set drives=%1 %drives%
:_quit