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-18 19:00
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » Is there a DOS command to determine if a file exists under NTFS in the format of X:Y\PATH\FILE? View 2,830 Replies 29
Floor 16 Posted 2007-03-30 02:11 ·  中国 江苏 常州 溧阳市 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
Is PSI okay? I used XUSEN to map my NTFS formatted primary partition C: to H: but the partition number is not 1, but comes later, which causes a problem!
Floor 17 Posted 2007-03-30 05:37 ·  中国 黑龙江 哈尔滨 电信
高级用户
★★★
Credits 760
Posts 357
Joined 2005-10-10 22:33
20-year member
UID 43332
Status Offline
Hehe, made a mistake, know what it's for now

[ Last edited by 0451lym on 2007-3-30 at 11:33 AM ]
Floor 18 Posted 2007-03-30 05:39 ·  中国 黑龙江 哈尔滨 电信
高级用户
★★★
Credits 760
Posts 357
Joined 2005-10-10 22:33
20-year member
UID 43332
Status Offline
I don't know what it's for either, you tell us the result of the experiment!
Floor 19 Posted 2007-03-30 11:58 ·  中国 江苏 常州 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
What is it for? How to use it?
Floor 20 Posted 2007-03-30 12:05 ·  中国 河南 开封 教育网
中级用户
★★
Credits 214
Posts 94
Joined 2007-01-11 10:39
19-year member
UID 76165
Gender Male
Status Offline
Recently, I have sorted out the boot disk, but after burning it, I found several problems in the actual machine.

1. For motherboards that support SATA, it is very easy for the PSI to analyze the hard disk information incorrectly. This is quite sad. I wonder if modifying the batch processing can improve this problem?

2. During the actual machine operation, DIRT also started to make mistakes (normal in the virtual machine). First, the last two lines of the search result are ERROR: CAN NOT GET COMMAND.COM'S PSP. Secondly, the modified search batch processing of XUSEN is directly interrupted and exited due to DIRT. Again, it is found that the search batch processing using DIRT sometimes gets stuck and dies on a certain drive letter.

In conclusion, I feel quite depressed.
Floor 21 Posted 2007-03-30 12:39 ·  中国 黑龙江 哈尔滨 电信
高级用户
★★★
Credits 760
Posts 357
Joined 2005-10-10 22:33
20-year member
UID 43332
Status Offline
Originally posted by llztt1 at 2007-3-30 12:05:
Recently, I have sorted out the boot disk, but after burning it, I found several problems in the actual machine.
1. Motherboards supporting SATA often cause PSI to analyze hard disk information incorrectly. This is quite frustrating. I wonder if the batch script can be modified...


1. Motherboards supporting SATA often cause PSI to analyze hard disk information incorrectly. I haven't encountered this. I tested that SATA hard disks are normal, but NTFS compressed partitions have serious errors! (SATA optical drives were not tested)
2. DIRT works normally. Mine was written by myself and didn't fully refer to XUSEN's search engine! DIRT searches the NT partitions of SATA hard disks at normal speed, but there is a problem of time delay when searching the NT partitions of old hard disks. If SMARTDRV is loaded, searching the NT partition sometimes crashes! Overall, it's still acceptable!
Floor 22 Posted 2007-03-30 12:43 ·  中国 黑龙江 哈尔滨 电信
高级用户
★★★
Credits 760
Posts 357
Joined 2005-10-10 22:33
20-year member
UID 43332
Status Offline
DIRT Search Engine

@ECHO OFF
REM --------------------------------------------------
IF "%ID%"=="N" goto JSA
SET CZWJ=%1>NUL
set ID=1>NUL
:BLFZ0
strings ID=add %ID%,1
for %%x in (%id%) do ECHO SET LS=%%%%x%%>%temp%\ls.bat
CALL %temp%\ls.bat %1 %2 %3 %4
if "%LS%"=="" goto KS
:BLFZ1
ECHO %LS%|find.exe /i "/L:">NUL
if ERRORLEVEL 1 goto BLFZ2
SET ZL=%LS%>NUL
goto BLFZ0
:BLFZ2
ECHO %LS%|find.exe /i "/D:">NUL
if ERRORLEVEL 1 goto BLFZ3
SET ZD=%LS%>NUL
goto BLFZ0
:BLFZ3
ECHO %LS%|find.exe /i "/T:">NUL
if ERRORLEVEL 1 goto BLFZ4
SET CZT=%LS%>NUL
goto BLFZ0
:BLFZ4
SET WJM=%LS%>NUL
goto BLFZ0
:xs
ECHO Searching→Data, please wait......>%temp%\XS.TXT
:KS
if NOT exist %temp%\XS.TXT goto xs
GO %RAMDRIVE%\BAT
wbat cls (white on blue)
wbat fill11,16(5,50)(+white on +blue)!text13,16@%temp%\XS.TXT
for %%x in (ID xs) do SET %%x=>NUL
if "%WJM%"=="" SET WJM=%temp%\CZ.TXT>NUL
if exist %WJM% del %WJM%
ECHO %CZWJ% | find.exe /i ":">NUL
if ERRORLEVEL 1 set ID=1
if "%ID%"=="" goto DFQ
for %%x in (bfb zrl) do SET %%x=0>NUL
wbat fill17,16(1,50)(white on +black)!text17,39(1,2)"%bfb%%%"
if exist %temp%\HDD.INI strings zrl=linesize %temp%\HDD.INI
:00
for %%x in (PSI CZFQ jdt bfb ls) do MYSET %%x=>NUL
strings ls=mul %ID%,100
strings bfb=div %ls%,%zrl%
strings jdt=div %bfb%,2
MYSET ls=>NUL
strings ID=add %ID%,1
if exist %temp%\HDD.INI strings PSI=read %temp%\HDD.INI,%ID%
if "%PSI%"=="" goto js
if exist %temp%\HDD.INI STRINGS CZFQ=MID %PSI%,1,2
wbat fill16,16(1,50)(+white on brown)!text16,16(1,2)"Searching %CZFQ%\"
MYSET PSI=>NUL
:cz
if "%CZWJ%"=="*.GHO" dirt %CZFQ%\*.GHO %ZD% %CZT% %ZL%|find.exe /i ":">>%WJM%
if "%CZWJ%"=="*.GHO" dirt %CZFQ%\*.LYM %ZD% %CZT% %ZL%|find.exe /i ":">>%WJM%
if not "%CZWJ%"=="*.GHO" dirt %CZFQ%\%CZWJ% %ZD% %CZT% %ZL%|find.exe /i ":">>%WJM%
wbat fill17,16(1,%jdt%)(white on green)!text17,39(1,2)"%bfb%%%"
GOTO 00
:DFQ
dirt %CZWJ% %ZD% %CZT% %ZL%|find.exe /i ":">>%WJM%
for %%x in (CZWJ ZL ZD CZT ID bfb jdt zrl) do SET %%x=
DIRT /ClearEnv
set id=1
goto JSA
:js
wbat cls (white on blue)
wbat fill11,16(5,50)(+white on +blue)!text13,16@%temp%\XS.TXT
wbat fill16,16(1,50)(+white on brown)!text16,37(1,2)"Search completed!"
wbat fill17,16(1,50)(white on green)!text17,39(1,2)"100%%"
for %%x in (CZWJ ZL ZD CZT bfb jdt zrl) do SET %%x=
DIRT /ClearEnv
set id=1
:JSA
IF NOT "%ID%"=="N" STRINGS /q CZWJ=READ %WJM%,%ID%
IF "%CZWJ%"=="" goto JSB
IF NOT "%ID%"=="N" strings /q ID=add %ID%,1
ATTRIB /n %CZWJ%>%temp%\lS.TXT
STRINGS /q LS=READ %temp%\lS.TXT,1
STRINGS /q SX=MID 1%LS%,7,4
STRINGS /Q LS=MID 1%LS%,4,1
SET SX=%LS%%SX%
DIR /A %CZWJ%|find.exe ":"|find.exe /v "\">%temp%\LS.TXT
STRINGS /q LS=READ %temp%\LS.TXT,1
STRINGS /q /P" LS1=PARSE %LS%"2".
IF NOT "%LS1%"=="" SET LS1=Folder
IF NOT "%LS1%"=="" GOTO JSA0
STRINGS /Q /P" LS1=MID %LS%"13"14
IF NOT "%LS1%"=="" STRINGS /q /P" LS2=PARSE %LS1%"1",
IF NOT "%LS2%"=="" STRINGS /Q /P" LS3=PARSE %LS1%"2",
IF NOT "%LS3%"=="" STRINGS /q /P" LS4=PARSE %LS1%"3",
IF NOT "%LS4%"=="" STRINGS /q /P" LS5=PARSE %LS1%"4",
SET LS1=%LS2%%LS3%%LS4%%LS5%>NUL
:JSA0
STRINGS /q /P" LS2=MID %LS%"29"10
STRINGS /q /P" LS3=MID %LS%"41"5
for %%x in (%ls3%) do set ls3=%%x>NUL
STRINGS /q /P" LS4=LENGTH %LS3%
IF "%LS4%"=="4" SET LS3=0%LS3%>NUL
SET LS=%LS1%>NUL
STRINGS /q LS=DIV %LS%,1024
IF "%LS%"=="0" CALC %LS1%/1024|find ".">%TEMP%\LS.TXT
WBAT CURSOR 1
IF "%LS%"=="0" STRINGS /q LS=READ %TEMP%\LS.TXT,1
FOR %%X IN (%LS%) DO SET LS=%%X>NUL
STRINGS /q LS4=LENGTH %LS%
STRINGS /q LS5=LENGTH %CZWJ%
STRINGS /q LS1=SUB 47,%LS4%,%ls5%
if "%ls%"=="" strings /q ls1=add %ls1%,4
STRINGS /q LS4=READ %RAMDRIVE%\BAT\CZ.BAT,2
STRINGS /q LS1=MID %LS4%,5,%LS1%
FOR %%X IN (LS4 LS5) DO SET %%X=>NUL
IF NOT "%LS%"=="" SET LS=%LS% KB >NUL
ECHO %CZWJ% %LS1%→ %LS%%LS2% %LS3% %SX%>>%temp%\WJ.TXT
FOR %%X IN (LS LS1 LS2 LS3 SX) DO SET %%X=>NUL
IF "%ID%"=="N" GOTO JSB
GOTO JSA
:JSB
wbat cls (white on blue)
if "%id%"=="1" CALL W.BAT fix BOX (+WHITE ON +BLUE) @BAT.INI:CZ_0
wbat cls (white on blue)
if exist %temp%\wj.txt TYPE %TEMP%\WJ.TXT>%WJM%
if "%id%"=="1" del %wjm%
FOR %%X IN (WJ.TXT LS.TXT XS.TXT LS.BAT) DO IF EXIST %TEMP%\%%X DEL %TEMP%\%%X
FOR %%X IN (wjm id CMDLINE) DO set %%X=>NUL
Floor 23 Posted 2007-03-30 12:52 ·  中国 黑龙江 哈尔滨 电信
高级用户
★★★
Credits 760
Posts 357
Joined 2005-10-10 22:33
20-year member
UID 43332
Status Offline
Then for judging the partition problem of the USB flash drive, it can be solved as follows:
When the drive letter is not switched in the AUTOEXEC command, use cd> to judge whether it is the C drive!
I don't know if it is feasible or not?
Floor 24 Posted 2007-03-30 12:55 ·  中国 河南 开封 教育网
中级用户
★★
Credits 214
Posts 94
Joined 2007-01-11 10:39
19-year member
UID 76165
Gender Male
Status Offline
Hey, I also hope it's not a DIRT issue. I'll test tomorrow whether it's a problem with the boot disk IO, SYS, or COMMAND.COM, or maybe an issue after GRUB is loaded.
Floor 25 Posted 2007-03-30 13:05 ·  中国 江苏 常州 溧阳市 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
Searching the first-level directory should be faster. By habit, GHO files are generally also in the first-level directory. Why is a search taking so long?
Floor 26 Posted 2007-03-30 13:10 ·  中国 黑龙江 哈尔滨 电信
高级用户
★★★
Credits 760
Posts 357
Joined 2005-10-10 22:33
20-year member
UID 43332
Status Offline
Originally posted by terse at 2007-3-30 13:05:
Searching the first-level directory should be faster. By habit, GHO files are generally also in the first-level directory. Why is a search taking so long?

1. It is necessary to judge whether it is a full-disk search or a single-partition search!
2. It is not only to search the first-level directory, but to truly conduct an all-round search!
3. It is necessary to know the results and sort them!
Hehe, I have streamlined this many times and made many changes!
Floor 27 Posted 2007-03-30 13:32 ·  中国 江苏 常州 溧阳市 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
Then why not try lmod to separate the part after X:\ at one time? Isn't that also convenient? And then processing with WBAT is also good?
Floor 28 Posted 2007-04-02 12:42 ·  中国 黑龙江 哈尔滨 电信
高级用户
★★★
Credits 760
Posts 357
Joined 2005-10-10 22:33
20-year member
UID 43332
Status Offline
Finally, after several more days of work, I finally achieved something! Both XUSEN's and my original ones took 30-50 seconds to boot into the system. Today I added a small command, and now it takes 10-13 seconds to boot into the system, and the search is extremely fast! Hehe, it's really a miracle!
Floor 29 Posted 2007-04-03 02:14 ·  中国 河南 开封 教育网
中级用户
★★
Credits 214
Posts 94
Joined 2007-01-11 10:39
19-year member
UID 76165
Gender Male
Status Offline
The slow speed is mainly consumed on PSI. As long as you use PSI to analyze hard disk information, it won't be fast. Unless you replace it. I also gave up the old version of the search batch processing of XUSEN. After removing the useless display of search percentage, the search speed is very fast.
Floor 30 Posted 2007-04-03 02:28 ·  中国 黑龙江 哈尔滨 电信
高级用户
★★★
Credits 760
Posts 357
Joined 2005-10-10 22:33
20-year member
UID 43332
Status Offline
I added a cache driver QCACHE.SYS and the speed became extremely fast (never use SMARTDRV, because DIRT will die!)

14 seconds to boot:

DEVICE=\SYS\MEM\HIMEM.SYS /TESTMEM:OFF
DEVICEHIGH=\SYS\MEM\EMM386.exe noems
DEVICEHIGH=\SYS\MEM\QSCACHE.SYS /F /S7



9 seconds to boot:

DEVICE=\SYS\MEM\HIMEM.SYS /TESTMEM:OFF
DEVICE=\SYS\MEM\UMBPCI.SYS /S
DEVICEHIGH=\SYS\MEM\QCACHE.SYS /L /S5
Forum Jump: