If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
OT Batch file
dir O:\ /s/b/o "o:\dl\misc\List\drive.txt"
What I am shooting for is to show files that are also in sub folders, but I don't want the path displayed. How do I modify this to not show the path? |
Ads |
#2
|
|||
|
|||
OT Batch file
Seymore,
How do I modify this to not show the path? You could try to remove the '/b', but I don't think you will like the result .... (too much crap besides the filenames). In short, you don't. But its possible without even using 'dir'. Like this: @echo off echo.$$$.txt for /r o:\ %%a in (*) do echo %%~nxa $$$.txt sort $$$.txt o:\dl\misc\List\drive.txt del $$$.txt Hope that helps. Regards, Rudy Wieser |
#3
|
|||
|
|||
OT Batch file
On Thu, 4 Jan 2018 18:24:03 +0100, "R.Wieser"
wrote: Seymore, How do I modify this to not show the path? You could try to remove the '/b', but I don't think you will like the result ... (too much crap besides the filenames). In short, you don't. But its possible without even using 'dir'. Like this: @echo off echo.$$$.txt for /r o:\ %%a in (*) do echo %%~nxa $$$.txt sort $$$.txt o:\dl\misc\List\drive.txt del $$$.txt Hope that helps. Regards, Rudy Wieser Can this be modified to use more than one drive? Thanks |
#4
|
|||
|
|||
OT Batch file
On Thu, 04 Jan 2018 13:35:57 -0500, Seymore4Head
wrote: On Thu, 4 Jan 2018 18:24:03 +0100, "R.Wieser" wrote: Seymore, How do I modify this to not show the path? You could try to remove the '/b', but I don't think you will like the result ... (too much crap besides the filenames). In short, you don't. But its possible without even using 'dir'. Like this: @echo off echo.$$$.txt for /r o:\ %%a in (*) do echo %%~nxa $$$.txt sort $$$.txt o:\dl\misc\List\drive.txt del $$$.txt Hope that helps. Regards, Rudy Wieser Can this be modified to use more than one drive? Thanks It can. I figured it out. Thanks again |
#5
|
|||
|
|||
OT Batch file
Seymore,
It can. I figured it out. :-) Good to hear you did it yourself. How did you do it though ? Duplicating the "for" line for each drive (which is probably the simpelest way to do it) ? Regards, Rudy Wieser |
#6
|
|||
|
|||
OT Batch file
On Thu, 4 Jan 2018 20:29:59 +0100, "R.Wieser"
wrote: Seymore, It can. I figured it out. :-) Good to hear you did it yourself. How did you do it though ? Duplicating the "for" line for each drive (which is probably the simpelest way to do it) ? Regards, Rudy Wieser Yep Thanks again. I wish I had been keeping a backup of my list like this years ago. |
#7
|
|||
|
|||
OT Batch file
Seymore,
Thanks again. You're welcome. I wish I had been keeping a backup of my list like this years ago. I'm guessing he to be able to find a long filename back for a mangled 8.3 name in a folder (after having used a DOS copy or program) ? :-) Regards, Rudy Wieser |
Thread Tools | |
Display Modes | |
|
|