PCbanter

PCbanter (http://www.pcbanter.net/index.php)
-   General XP issues or comments (http://www.pcbanter.net/forumdisplay.php?f=18)
-   -   OT Batch file (http://www.pcbanter.net/showthread.php?t=1102695)

Seymore4Head[_2_] January 4th 18 02:51 PM

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?

R.Wieser January 4th 18 05:24 PM

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



Seymore4Head[_2_] January 4th 18 06:35 PM

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

Seymore4Head[_2_] January 4th 18 06:52 PM

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

R.Wieser January 4th 18 07:29 PM

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



Seymore4Head[_2_] January 5th 18 11:51 PM

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.

R.Wieser January 6th 18 09:07 AM

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




All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2004 - 2006 PCbanter
Comments are property of their posters