|
solover
新手上路

积分 13
发帖 5
注册 2006-11-15
状态 离线
|
『楼 主』:
新手求助,实现让dir不显示扩展名!
使用 LLM 解释/回答一下
初到贵坛子,学习了很多前辈的经验,表示感谢,另求一个把当前目录里的文件重定向到新的文本文件,但是在文本文件里只要文件名,不要它显示扩展名。谢谢了!
Last edited by solover on 2006-11-14 at 04:51 PM ]
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 ]
|
|
2006-11-15 05:49 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
@echo off
cd.>List.txt
for /f %%i in ('dir/b') do echo %%~ni>>List.txt
```@echo off
cd.>List.txt
for /f %%i in ('dir/b') do echo %%~ni>>List.txt
|
|
2006-11-15 05:56 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
dir/b
|

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'>" |
|
2006-11-15 05:58 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
楼上没看仔细,LZ不要扩展名^_^
The person upstairs didn't read carefully. LZ doesn't want the file extension ^_^
|
|
2006-11-15 06:00 |
|
|
solover
新手上路

积分 13
发帖 5
注册 2006-11-15
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
先谢谢zxcv大虾,辛苦了 !我试试去。
First, thank you,大虾 zxcv, you've worked hard! I'll give it a try.
|
|
2006-11-15 06:05 |
|
|
solover
新手上路

积分 13
发帖 5
注册 2006-11-15
状态 离线
|
|
2006-11-15 06:08 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
2F的把文件夹的名字也显示出来了,对带空格的文件名也没考虑进去。在2F的基础上修改一下:
@echo off
cd.>List.txt
for /f "delims=" %%i in ('dir /a-d /b') do >>List.txt echo %%~ni>>List.txt
start List.txt
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没商量。
考虑问题复杂化,解决问题简洁化。 |
|
2006-11-15 06:19 |
|
|
solover
新手上路

积分 13
发帖 5
注册 2006-11-15
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
感谢热心的版主,这里真是好地方,有种家的感觉。
永远支持dos联盟
Thanks to the enthusiastic moderators, this is really a great place, feeling like home.
Always support the DOS Union
|
|
2006-11-15 06:21 |
|
|
solover
新手上路

积分 13
发帖 5
注册 2006-11-15
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
还有一问题,请各位大虾帮忙,我想对几个不同的后缀的文件进行操作,操作后重新写回去,有什么办法可以忽略后缀名(按原始后缀名保存),批处理可否实现?可以变通,只要能达到上述目的
------------------------------------
原始命令行:
FOR /F %%I IN (list.txt) DO quick -j/%%I.tba//%%I.tba/ %%I.exe
重要的是后面的exe文件名我不需要要指定,因为需要生成的文件有其他后缀的。
说明:llist.txt是刚才两位楼主提供的批处理生成的。
Last edited by solover on 2006-11-14 at 05:40 PM ]
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 ]
|
|
2006-11-15 06:36 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
你的描述说得不是很清楚,让人难以理解你的真正意图:这几个文件是保存在某个目录下,还是把这几个文件的名字保存到了 list.txt 中?你不举例还好,一举例反倒有点让人糊涂了。
另外,相同内容的帖子请不要另开新帖来提问,一来方便别人在一个帖子中集中作答,另一方面,也可以解决论坛资源,方便论坛的管理。你的另一个帖其实就是你在 9F 的内容,我已删除,请理解。
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没商量。
考虑问题复杂化,解决问题简洁化。 |
|
2006-11-15 07:10 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
9楼的兄弟可否把问题阐述清楚点啊?
我还没有理解你要干什么。
我想对几个不同的后缀的文件进行操作
对哪几个不同的后缀的文件进行什么操作?你或者举几个例子来说明你想实现什么。
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.
|
|
2006-11-15 11:10 |
|