![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-02 11:30 |
48,038 topics / 350,123 posts / today 1 new / 48,251 members |
| DOS批处理 & 脚本技术(批处理室) » Newcomer seeking help, how to make dir not display file extensions! |
| Printable Version 1,749 / 10 |
| Floor1 solover | Posted 2006-11-15 05:49 |
| 新手上路 Posts 5 Credits 13 | |
|
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 ] |
|
| Floor2 zh159 | Posted 2006-11-15 05:56 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
|
```@echo off
cd.>List.txt for /f %%i in ('dir/b') do echo %%~ni>>List.txt |
|
| Floor3 electronixtar | Posted 2006-11-15 05:58 |
| 铂金会员 Posts 2,672 Credits 7,493 | |
| Floor4 zh159 | Posted 2006-11-15 06:00 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
|
The person upstairs didn't read carefully. LZ doesn't want the file extension ^_^
|
|
| Floor5 solover | Posted 2006-11-15 06:05 |
| 新手上路 Posts 5 Credits 13 | |
|
First, thank you,大虾 zxcv, you've worked hard! I'll give it a try.
|
|
| Floor6 solover | Posted 2006-11-15 06:08 |
| 新手上路 Posts 5 Credits 13 | |
|
Test passed, thank you again
|
|
| Floor7 namejm | Posted 2006-11-15 06:19 |
| 荣誉版主 Posts 1,737 Credits 5,226 From 成都 | |
|
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:
|
|
| Floor8 solover | Posted 2006-11-15 06:21 |
| 新手上路 Posts 5 Credits 13 | |
|
Thanks to the enthusiastic moderators, this is really a great place, feeling like home.
Always support the DOS Union |
|
| Floor9 solover | Posted 2006-11-15 06:36 |
| 新手上路 Posts 5 Credits 13 | |
|
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 ] |
|
| Floor10 namejm | Posted 2006-11-15 07:10 |
| 荣誉版主 Posts 1,737 Credits 5,226 From 成都 | |
|
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. |
|
| Floor11 lxmxn | Posted 2006-11-15 11:10 |
| 版主 Posts 4,938 Credits 11,386 | |
|
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. |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |