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-13 02:23
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » [Help] A question for the batch file experts View 647 Replies 3
Original Poster Posted 2003-10-02 00:00 ·  新西兰
初级用户
Credits 115
Posts 4
Joined 2003-10-02 00:00
22-year member
UID 10635
Gender Male
Status Offline
How can I identify a file's extension in a batch file?
For example, I have 2 files, one is *.htm, the other is *.jpg. I want to delete the *.htm file — how do I identify the extension?
Floor 2 Posted 2003-10-02 00:00 ·  中国 湖北 荆门 京山市 电信
初级用户
Credits 183
Posts 15
Joined 2003-07-07 00:00
23-year member
UID 6493
Gender Male
Status Offline
It seems just using
dEL *.htm
is OK
Floor 3 Posted 2003-10-02 00:00 ·  新西兰
初级用户
Credits 115
Posts 4
Joined 2003-10-02 00:00
22-year member
UID 10635
Gender Male
Status Offline
Thanks
Floor 4 Posted 2003-12-06 00:00 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
Credits 5,154
Posts 1,827
Joined 2003-07-18 00:00
23-year member
UID 7105
Gender Male
Status Offline
This seems like looking for the horse while sitting on it!
You've already written the extension in your question, so why are you still asking how to identify it? Can't you just type it in! Too strange!
It's like asking, "Comrade Wang Weibing, what's your name?"
Heh! The poster above didn't find it strange at all! He answered, "use del *.htm" — that's kind of like helping by saying, "Oh! You mean Wang Weibing! His name is Wang Weibing!"


Forum Jump: