请参考xyfpath.bat:
@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=
IsReady.BAT:
@echo off
dready %1 > nul
if errorlevel 1 goto _quit
if errorlevel 0 set drives=%1 %drives%
:_quit