Hi,
From a folder i should print all the filenames with its directory name only once. how I can it using batch script.
say these are file names:
D:\files\year\2010\html.txt
D:\files\year\2010\java2.html
D:\files\year\2010\pla.html
D:\files\year\2011\README
D:\files\year\2011\fetch.xml
D:\files\year\2011\inifile.upd
Output should be:
2010\
html.txt
java2.html
pla.html
2011\
README
fetch.xml
inifile.upd
3 replies to this topic
#1
Posted 18 February 2011 - 12:36 AM
|
|
|
#2
Posted 23 February 2011 - 12:00 PM
Is there any specific reason you are doing this with a batch script? You can use a .bat file to call a vbscript or a .NET console program that will do this for you and write the information to the console.
-CDG10620
Software Developer
Software Developer
#3
Posted 23 February 2011 - 09:55 PM
I believe the DOS command 'tree' will do this for you, although I am not sure if it exists anymore.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#4
Posted 25 February 2011 - 05:06 PM
This is about the closest I can get you to it without using tree.
DIR D:\Files\year /S /W
If you want them sorted alphabetically within their respective folders:
DIR D:\Files\year /S /W /ON
DIR D:\Files\year /S /W
If you want them sorted alphabetically within their respective folders:
DIR D:\Files\year /S /W /ON
Edited by dargueta, 25 February 2011 - 05:15 PM.
Fixed syntax error
sudo rm -rf /
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









