中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-10-24 15:28
47,815 topics / 349,928 posts / today 0 new / 48,288 members
DOS疑难解答 & 问题讨论 (解答室) » How to respectively get the drive letter and path in a batch file? Thanks!
Printable Version  5,502 / 25
Floor16 chujiafu Posted 2007-02-01 23:11
银牌会员 Posts 595 Credits 1,339 From 安徽 宿州
I don't understand what the owner of the building is going to do?
Floor17 zybird Posted 2007-02-02 08:06
中级用户 Posts 53 Credits 240
@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
Floor18 llztt Posted 2007-02-07 04:07
中级用户 Posts 44 Credits 204
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?
Floor19 0451lym Posted 2007-02-07 06:02
高级用户 Posts 357 Credits 760
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
Floor20 0451lym Posted 2007-02-07 06:54
高级用户 Posts 357 Credits 760
Don't copy it blindly because there is a small mistake, which is in the usage. This...
Floor21 zybird Posted 2007-02-08 11:34
中级用户 Posts 53 Credits 240
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
Floor22 llztt1 Posted 2007-02-08 12:11
中级用户 Posts 94 Credits 214
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...
Floor23 jzzys Posted 2007-04-09 05:27
新手上路 Posts 4 Credits 8
I am just in need of such software and tutorials, thanks to the brother 0451lym
Floor24 jeffery319 Posted 2007-06-28 10:20
新手上路 Posts 1 Credits 2
Learn it, just need to use this function
Floor25 shaojun Posted 2007-07-02 22:08
新手上路 Posts 1 Credits 2
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.
Floor26 zjd713 Posted 2010-02-24 01:23
新手上路 Posts 1 Credits 2
Can't download GetInfo 1.21?
Prev  1 2
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023