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-08-15 11:04
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » How to respectively get the drive letter and path in a batch file? Thanks! View 5,058 Replies 25
Floor 16 Posted 2007-02-01 23:11 ·  中国 安徽 宿州 泗县 电信
银牌会员
★★★
Credits 1,339
Posts 595
Joined 2004-05-26 00:00
22-year member
UID 25306
Gender Male
From 安徽 宿州
Status Offline
I don't understand what the owner of the building is going to do?
Floor 17 Posted 2007-02-02 08:06 ·  中国 广东 潮州 电信
中级用户
★★
Credits 240
Posts 53
Joined 2005-01-21 00:00
21-year member
UID 35493
Gender Male
Status Offline
@echo off
Dirt e:\book.bat /Q
if %DirtRet%==Fail goto NoFind

echo "book.bat" is at %fpath%

goto quit

:NoFind
echo.
echo.
echo book.bat not found at E:
:quit
Floor 18 Posted 2007-02-07 04:07 ·  中国 河南 开封 教育网
中级用户
Credits 204
Posts 44
Joined 2003-08-08 00:00
23-year member
UID 8224
Gender Male
Status Offline
This question was misunderstood by the several people upstairs. For example, everyone knows that after setting the PATH path properly, you can type a batch file within the PATH path range in any location to run it. How to modify this batch file to add a function that when this batch file runs, it first displays its own path? The several people upstairs all used the search function to find this batch file and then get its path. If there are several files with the same name, then it's not easy to handle, right?
Floor 19 Posted 2007-02-07 06:02 ·  中国 黑龙江 哈尔滨 电信
高级用户
★★★
Credits 760
Posts 357
Joined 2005-10-10 22:33
20-year member
UID 43332
Status Offline
cls
ECHO Searching for files......
DIRT /CLEARENV>NUL
:00
IF "%CZFQ%" == "" set CZFQ=C>NUL
GOTO CZ
:c
set CZFQ=D>NUL
GOTO CZ
:D
set CZFQ=E>NUL
GOTO CZ
:E
set CZFQ=F>NUL
GOTO CZ
:F
set CZFQ=G>NUL
GOTO CZ
:G
set CZFQ=H>NUL
GOTO CZ
:H
set CZFQ=I>NUL
GOTO CZ
:I
set CZFQ=J>NUL
GOTO CZ
:J
set CZFQ=K>NUL
GOTO CZ
:K
set CZFQ=L>NUL
GOTO CZ
:L
set CZFQ=M>NUL
GOTO CZ
:M
set CZFQ=N>NUL
GOTO CZ
:N
set CZFQ=O>NUL
GOTO CZ
:O
set CZFQ=P>NUL
GOTO CZ
:P
set CZFQ=Q>NUL
GOTO CZ
:Q
set CZFQ=R>NUL
GOTO CZ
:R
set CZFQ=S>NUL
GOTO CZ
:S
set CZFQ=T>NUL
GOTO CZ
:T
set CZFQ=U>NUL
GOTO CZ
:U
set CZFQ=V>NUL
GOTO CZ
:V
set CZFQ=W>NUL
GOTO CZ
:W
set CZFQ=>NUL
GOTO TC

:cz
dirt %CZFQ%:\%CZWJ% /L:%ZML% /Out2Env>NUL
IF "%O2E_FName0%" == "" GOTO %CZFQ%
:CZ1
IF not "%O2E_FName0%" == "" GOTO WJBL0
IF not "%O2E_FName1%" == "" GOTO WJBL1
IF not "%O2E_FName2%" == "" GOTO WJBL2
IF not "%O2E_FName3%" == "" GOTO WJBL3
IF not "%O2E_FName4%" == "" GOTO WJBL4
IF not "%O2E_FName5%" == "" GOTO WJBL5
IF not "%O2E_FName6%" == "" GOTO WJBL6
IF not "%O2E_FName7%" == "" GOTO WJBL7
IF not "%O2E_FName8%" == "" GOTO WJBL8
IF not "%O2E_FName9%" == "" GOTO WJBL9
GOTO %CZFQ%
:WJBL0
SET WJBL=%O2E_Driver0%\%O2E_Path0%\%O2E_FName0%
myset O2E_Driver0=>NUL
myset O2E_Path0=>NUL
myset O2E_FName0=>NUL
GOTO CZ2
:WJBL1
SET WJBL=%O2E_Driver1%\%O2E_Path1%\%O2E_FName1%
myset O2E_Driver1=>NUL
myset O2E_Path1=>NUL
myset O2E_FName1=>NUL
GOTO CZ2
:WJBL2
SET WJBL=%O2E_Driver2%\%O2E_Path2%\%O2E_FName2%
myset O2E_Driver2=>NUL
myset O2E_Path2=>NUL
myset O2E_FName2=>NUL
GOTO CZ2
:WJBL3
SET WJBL=%O2E_Driver3%\%O2E_Path3%\%O2E_FName3%
myset O2E_Driver3=>NUL
myset O2E_Path3=>NUL
myset O2E_FName3=>NUL
GOTO CZ2
:WJBL4
SET WJBL=%O2E_Driver4%\%O2E_Path4%\%O2E_FName4%
myset O2E_Driver4=>NUL
myset O2E_Path4=>NUL
myset O2E_FName4=>NUL
GOTO CZ2
:WJBL5
SET WJBL=%O2E_Driver5%\%O2E_Path5%\%O2E_FName5%
myset O2E_Driver5=>NUL
myset O2E_Path5=>NUL
myset O2E_FName5=>NUL
GOTO CZ2
:WJBL6
SET WJBL=%O2E_Driver6%\%O2E_Path6%\%O2E_FName6%
myset O2E_Driver6=>NUL
myset O2E_Path6=>NUL
myset O2E_FName6=>NUL
GOTO CZ2
:WJBL7
SET WJBL=%O2E_Driver7%\%O2E_Path7%\%O2E_FName7%
myset O2E_Driver7=>NUL
myset O2E_Path7=>NUL
myset O2E_FName7=>NUL
GOTO CZ2
:WJBL8
SET WJBL=%O2E_Driver8%\%O2E_Path8%\%O2E_FName8%
myset O2E_Driver8=>NUL
myset O2E_Path8=>NUL
myset O2E_FName8=>NUL
GOTO CZ2
:WJBL9
SET WJBL=%O2E_Driver9%\%O2E_Path9%\%O2E_FName9%
myset O2E_Driver9=>NUL
myset O2E_Path9=>NUL
myset O2E_FName9=>NUL
GOTO CZ2
:CZ2
IF "%WJ1%" == "" GOTO WJ1
IF "%WJ2%" == "" GOTO WJ2
IF "%WJ3%" == "" GOTO WJ3
IF "%WJ4%" == "" GOTO WJ4
IF "%WJ5%" == "" GOTO WJ5
IF "%WJ6%" == "" GOTO WJ6
IF "%WJ7%" == "" GOTO WJ7
IF "%WJ8%" == "" GOTO WJ8
IF "%WJ9%" == "" GOTO WJ9
IF "%WJ10%" == "" GOTO WJ10
GOTO TC
:WJ1
SET WJ1=%WJBL%
SET WJBL=>NUL
GOTO CZ1
:WJ2
SET WJ2=%WJBL%
SET WJBL=>NUL
GOTO CZ1
:WJ3
SET WJ3=%WJBL%
SET WJBL=>NUL
GOTO CZ1
:WJ4
SET WJ4=%WJBL%
SET WJBL=>NUL
GOTO CZ1
:WJ5
SET WJ5=%WJBL%
SET WJBL=>NUL
GOTO CZ1
:WJ6
SET WJ6=%WJBL%
SET WJBL=>NUL
GOTO CZ1
:WJ7
SET WJ7=%WJBL%
SET WJBL=>NUL
GOTO CZ1
:WJ8
SET WJ8=%WJBL%
SET WJBL=>NUL
GOTO CZ1
:WJ9
SET WJ9=%WJBL%
SET WJBL=>NUL
GOTO CZ1
GOTO %CZFQ%
:WJ10
SET WJ10=%WJBL%
SET WJBL=>NUL
GOTO CZ1
:TC
DIRT /CLEARENV>NUL
SET CZWJ=>NUL
SET ZML=>NUL
set CMDLINE=>NUL
Floor 20 Posted 2007-02-07 06:54 ·  中国 黑龙江 哈尔滨 电信
高级用户
★★★
Credits 760
Posts 357
Joined 2005-10-10 22:33
20-year member
UID 43332
Status Offline
Don't copy it blindly because there is a small mistake, which is in the usage. This...
Floor 21 Posted 2007-02-08 11:34 ·  中国 广东 潮州 电信
中级用户
★★
Credits 240
Posts 53
Joined 2005-01-21 00:00
21-year member
UID 35493
Gender Male
Status Offline
Originally posted by llztt at 2007-2-7 04:07 AM:
The several people upstairs all use the search function to find out this batch processing then obtain its path, if there are several files with the same name, then it is not easy to handle, right.



The biggest characteristic of dirt.com is that it supports searching for specified files using the "creation/modification date" or "creation/modification time" of the file,

So, if you know the file name of the batch processing you are looking for and the "time or date", you can use the date or time search function of dirt, and the chance of making a mistake is very low
Floor 22 Posted 2007-02-08 12:11 ·  中国 河南 开封 教育网
中级用户
★★
Credits 214
Posts 94
Joined 2007-01-11 10:39
19-year member
UID 76165
Gender Male
Status Offline
It's a pity that this function requires generality and is for general categories. Don't expect to remember the attributes of this batch processing...
Floor 23 Posted 2007-04-09 05:27 ·  中国 山西 晋中 联通
新手上路
Credits 8
Posts 4
Joined 2007-04-01 14:44
19-year member
UID 83631
Gender Male
Status Offline
I am just in need of such software and tutorials, thanks to the brother 0451lym
Floor 24 Posted 2007-06-28 10:20 ·  中国 安徽 合肥 电信
新手上路
Credits 2
Posts 1
Joined 2007-03-21 00:29
19-year member
UID 82391
Gender Male
Status Offline
Learn it, just need to use this function
Floor 25 Posted 2007-07-02 22:08 ·  中国 重庆 联通
新手上路
Credits 2
Posts 1
Joined 2007-07-02 20:08
19-year member
UID 92966
Gender Male
Status Offline
I can't directly download files for you. But you can try to search for these two websites (dirt.com and getinfo.com) on relevant search engines or software download platforms to see if you can find the tools you need.
Floor 26 Posted 2010-02-24 01:23 ·  加拿大
新手上路
Credits 2
Posts 1
Joined 2010-02-23 09:17
16-year member
UID 161040
Gender Male
Status Offline
Can't download GetInfo 1.21?
Forum Jump: