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-02 12:54
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Newcomer seeking help, how to make dir not display file extensions! View 1,750 Replies 10
Original Poster Posted 2006-11-15 05:49 ·  中国 四川 资阳 电信
新手上路
Credits 13
Posts 5
Joined 2006-11-15 05:24
19-year member
UID 70518
Gender Male
Status Offline
Just arrived at this forum, learned a lot from the experiences of seniors, and would like to express gratitude. Also, I need a way to redirect the files in the current directory to a new text file, but only have the file names in the text file, without showing the extensions.

[ Last edited by solover on 2006-11-14 at 04:51 PM ]
Floor 2 Posted 2006-11-15 05:56 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
```@echo off
cd.>List.txt
for /f %%i in ('dir/b') do echo %%~ni>>List.txt
Floor 3 Posted 2006-11-15 05:58 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 4 Posted 2006-11-15 06:00 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
The person upstairs didn't read carefully. LZ doesn't want the file extension ^_^
Floor 5 Posted 2006-11-15 06:05 ·  中国 四川 资阳 电信
新手上路
Credits 13
Posts 5
Joined 2006-11-15 05:24
19-year member
UID 70518
Gender Male
Status Offline
First, thank you,大虾 zxcv, you've worked hard! I'll give it a try.
Floor 6 Posted 2006-11-15 06:08 ·  中国 四川 资阳 电信
新手上路
Credits 13
Posts 5
Joined 2006-11-15 05:24
19-year member
UID 70518
Gender Male
Status Offline
Test passed, thank you again
Floor 7 Posted 2006-11-15 06:19 ·  中国 广东 佛山 广东睿江科技有限公司
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
The 2F one shows the folder names as well, and it didn't consider file names with spaces. Modify it based on the 2F one:


@echo off
cd.>List.txt
for /f "delims=" %%i in ('dir /a-d /b') do >>List.txt echo %%~ni>>List.txt
start List.txt
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 8 Posted 2006-11-15 06:21 ·  中国 四川 资阳 电信
新手上路
Credits 13
Posts 5
Joined 2006-11-15 05:24
19-year member
UID 70518
Gender Male
Status Offline
Thanks to the enthusiastic moderators, this is really a great place, feeling like home.

Always support the DOS Union
Floor 9 Posted 2006-11-15 06:36 ·  中国 四川 资阳 电信
新手上路
Credits 13
Posts 5
Joined 2006-11-15 05:24
19-year member
UID 70518
Gender Male
Status Offline
There is another question. Please help, everyone. I want to operate on several files with different suffixes and write them back after operation. Is there a way to ignore the suffix name (save according to the original suffix name)? Can batch processing achieve this? It can be flexible, as long as the above purpose is achieved.
------------------------------------
Original command line:
FOR /F %%I IN (list.txt) DO quick -j/%%I.tba//%%I.tba/ %%I.exe

The important thing is that I don't need to specify the exe file name later, because the files to be generated have other suffixes.

Note: llist.txt is the batch processing generated by the two previous poster.

[ Last edited by solover on 2006-11-14 at 05:40 PM ]
Floor 10 Posted 2006-11-15 07:10 ·  中国 广东 佛山 广东睿江科技有限公司
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
Your description is not very clear, making it difficult to understand your real intention: Are these several files saved in a certain directory, or is the names of these several files saved into list.txt? It's better that you don't give examples. Once you give examples, it's a bit confusing.

In addition, please don't open a new post to ask questions for posts with the same content. On the one hand, it is convenient for others to answer concentratedly in one post. On the other hand, it can also save forum resources and facilitate forum management. Your other post is actually the content you posted in 9F, and I have deleted it. Please understand.
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 11 Posted 2006-11-15 11:10 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  Could the brother on floor 9 please elaborate on the problem more clearly?

  I still haven't understood what you're trying to do.
I want to operate on several files with different extensions


  Which specific operations do you want to perform on the files with different extensions? You can either give a few examples to illustrate what you want to achieve.
Forum Jump: