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-06-27 18:43
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Seek help, create a folder in the last drive letter View 5,053 Replies 27
Floor 16 Posted 2006-09-28 22:23 ·  中国 福建 南平 电信
初级用户
Credits 197
Posts 33
Joined 2003-07-24 00:00
22-year member
UID 7424
Gender Male
Status Offline
Above the building
Can it be used if added?
For example C: D: E: F:
FAT32 NTFS NTFS FAT32
How are the drive letters arranged after loading partitions under DOS? Is the last drive letter the last partition?
If the last partition is in NTFS format, can the loaded NTFS driver write data to the NTFS format?
I know that OMNIFS can write data to the NTFS format, but I don't know how to find out how many partitions there are and set it as a variable %disk%
omnifs mkdir 1.%disk%
Floor 17 Posted 2006-09-28 23:08 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
Posting a piece of code from my own DOS maintenance disk, it's my treasure
Using the general method for DOS and CMD with gdisk and gdisk32, no need to load the annoying NTFS driver.
Gdisk Version 8.3

@echo off
::China DOS Union Forum: fastslz
FOR %%A IN (id1 id2 id3 id4 id5 id6 id7 id8 id9) DO SET %%A=
Gdisk 1 >Gdisk.TXT
FIND /i /n "NTFS" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id1=C drive (NTFS)
FIND /i /n "FAT32" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id1=C drive (FAT32)
FIND /i /n "NTFS" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id2=D drive (NTFS)
FIND /i /n "FAT32" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id2=D drive (FAT32)
FIND /i /n "NTFS" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id3=E drive (NTFS)
FIND /i /n "FAT32" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id3=E drive (FAT32)
FIND /i /n "NTFS" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id4=F drive (NTFS)
FIND /i /n "FAT32" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id4=F drive (FAT32)
FIND /i /n "NTFS" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id5=G drive (NTFS)
FIND /i /n "FAT32" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id5=G drive (FAT32)
FIND /i /n "NTFS" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id6=H drive (NTFS)
FIND /i /n "FAT32" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id6=H drive (FAT32)
FIND /i /n "NTFS" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id7=I drive (NTFS)
FIND /i /n "FAT32" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id7=I drive (FAT32)
FIND /i /n "NTFS" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id8=J drive (NTFS)
FIND /i /n "FAT32" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id8=J drive (FAT32)
FIND /i /n "NTFS" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id9=K drive (NTFS)
FIND /i /n "FAT32" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 set id9=K drive (FAT32)
cls
echo.
echo.
echo Display the number of partitions and disk type on the first hard drive
echo.
echo %id1% %id2% %id3% %id4% %id5% %id6% %id7% %id8% %id9%
PAUSE >NUL
rem del Gdisk.TXT
第一高手 第二高手

Floor 18 Posted 2006-09-28 23:31 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
If considering that your boot disk is multi-purpose, some hard drives having more than 2 primary partition codes are incorrect. Modify it yourself.

Take floor 17 as Scheme 1.

FIND /i /n "PRIMARY" Gdisk.TXT|FIND /i "" >nul
if not errorlevel 1 ECHO There are more than 2 primary partitions on your first hard drive.
GOTO Scheme 2
:Scheme 2
.........Don't repeat, weigh and modify by yourself.

If you think this method is good, give me a rating哦

[ Last edited by fastslz on 2006-9-28 at 23:33 ]
第一高手 第二高手

Floor 19 Posted 2006-09-30 04:09 ·  中国 广东 东莞 电信
中级用户
★★
Credits 282
Posts 130
Joined 2006-09-20 22:25
19-year member
UID 63201
From 广东
Status Offline
Learned something, thanks!
Floor 20 Posted 2006-09-30 04:09 ·  中国 广东 东莞 电信
中级用户
★★
Credits 282
Posts 130
Joined 2006-09-20 22:25
19-year member
UID 63201
From 广东
Status Offline
Learning
Floor 21 Posted 2006-09-30 05:59 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
This is also the best solution for dealing with DOS and Windows! Under the native Windows situation of a single hard drive, the system drive letters are exactly the same!
第一高手 第二高手

Floor 22 Posted 2007-01-25 08:31 ·  中国 广东 广州 珠江宽频
中级用户
★★
Credits 210
Posts 85
Joined 2007-01-14 12:38
19-year member
UID 76501
Gender Male
From 广东广州
Status Offline
A bit late, learning...

Referencing the idea of brother redtek on floor 6, the code compatible with pure DOS mode is as follows:
@ECHO OFF
FOR %%i 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 IF EXIST %%i:\nul SET last=%%i:
MD %last%\tmp
(Testing environment: winXPsp2_CMD, MSDOS7.10)

Problems under pure DOS:
1. The IF command cannot directly test the existence of a drive letter, which can be achieved by testing an empty directory (nul); is there a better way?
2. The FOR command also cannot use "GOTO :EOF" to exit the loop. Asking brother redtek and everyone, is there any method to achieve "exit the FOR when the condition is met"?

wait...
Floor 23 Posted 2007-02-01 03:27 ·  中国 广东 中山 广东瑞江科技有限公司BGP数据中心
初级用户
白小痴
Credits 48
Posts 23
Joined 2006-09-16 01:45
19-year member
UID 62709
Gender Male
Status Offline
Hehe. Everyone is so enthusiastic. Next time I have questions, I will trouble you all too. There are really many things to learn from the experts.
Floor 24 Posted 2007-02-11 13:52 ·  中国 天津 东丽区 电信
初级用户
Credits 42
Posts 20
Joined 2007-02-02 04:25
19-year member
UID 78384
Gender Male
Status Offline
Didn't understand: Isn't it just creating a folder in a partition? MD?
What is the last partition? Still don't understand? In Windows, it's generally the first-come-first-served, arranged by letter index. Is the last partition the one arranged at the end? In the boot detection in DOS, the last one? ——All exclude unrecognizable and unwritable partitions. If so: Let's raise a question——Today you can create a directory in the last partition; if the drive letter is changed tomorrow or the day after tomorrow, will it still be in the last partition? We question its practical value! If not: The LZ's system has Linux, and the above said are all nonsense.
Floor 25 Posted 2007-02-11 19:06 ·  中国 黑龙江 哈尔滨 电信
高级用户
★★★
Credits 760
Posts 357
Joined 2005-10-10 22:33
20-year member
UID 43332
Status Offline
Hehe, still this problem is annoying.

Partition separator conversion is okay.

One method: when booting the system, directly convert it into the analysis file of the partition separator. Then call it in the way of 1.1: 1.2: 1.3: 1.4:......) to judge the last partition separator of the first hard disk, then convert it into a drive letter, and MD to establish. Or make a self-extracting empty folder package, copy it over and release it automatically!

The second method is basically similar, so I won't go into details!
Floor 26 Posted 2007-02-11 19:12 ·  中国 黑龙江 哈尔滨 电信
高级用户
★★★
Credits 760
Posts 357
Joined 2005-10-10 22:33
20-year member
UID 43332
Status Offline
If you want to know more, please analyze the works of XUSEN. The time to start the machine and analyze the partition separator is about 30 seconds!
Or take a look at some posts from the recent discussion about partition drive letter conversion between me and llztt1!

[ Last edited by 0451lym on 2007-2-11 at 07:14 PM ]
Floor 27 Posted 2007-02-20 09:12 ·  中国 广东 广州 电信
新手上路
Credits 16
Posts 7
Joined 2005-12-21 13:25
20-year member
UID 47588
Status Offline
Floor 28 Posted 2007-02-20 14:15 ·  中国 河北 邯郸 联通
中级用户
★★
Credits 223
Posts 59
Joined 2005-05-23 00:00
21-year member
UID 39002
Gender Male
Status Offline
Where can I find Gdisk8.3???
Forum Jump: