Reply by Klaus Vestergaard Kragelund December 27, 20222022-12-27
On 25-12-2022 17:04, John Larkin wrote:
> > > Given a folder C:\Protos, I want a batch file to find all sub-folders, > possibly a few levels deep, called OLD, and delete all of them. I > can't make that work. > > When we develop a prototype PCB, we name iterations board1, board2, > etc, and drag the old ones into an OLD folder until it's done. Spice > folders get a OLD sub-folder too. > > Windows batch files don't make a lot of sense to me. Too many > ambiguities. > > For example, > > C:\Protos\Z540_P940_Load_Board\PCB\OLD > > is full of obsolete iterations. > >
Use Total Commander. To a "Search", feed the results back to the active window, Delete
Reply by Jasen Betts December 27, 20222022-12-27
On 2022-12-25, John Larkin <jlarkin@highlandSNIPMEtechnology.com> wrote:
> On Sun, 25 Dec 2022 11:35:12 -0800 (PST), Lasse Langwadt Christensen ><langwadt@fonz.dk> wrote: > >>s&oslash;ndag den 25. december 2022 kl. 17.04.20 UTC+1 skrev John Larkin: >>> Given a folder C:\Protos, I want a batch file to find all sub-folders, >>> possibly a few levels deep, called OLD, and delete all of them. I >>> can't make that work. >>> >>> When we develop a prototype PCB, we name iterations board1, board2, >>> etc, and drag the old ones into an OLD folder until it's done. Spice >>> folders get a OLD sub-folder too. >>> >>> Windows batch files don't make a lot of sense to me. Too many >>> ambiguities. >>> >>> For example, >>> >>> C:\Protos\Z540_P940_Load_Board\PCB\OLD >>> >>> is full of obsolete iterations. >> >>https://code.adonline.id.au/powershell-delete-folders-based-on-name/ >> >>? > > Yikes. Maybe I'll just have someone do it. > > I could write a PowerBasic program, I guess.
maybe use a port of GNU find. https://gnuwin32.sourceforge.net/packages/findutils.htm "C:\path_to\find.exe C:\Protos -name OLD -type d -delete" -- Jasen.
Reply by Lasse Langwadt Christensen December 26, 20222022-12-26
mandag den 26. december 2022 kl. 19.39.18 UTC+1 skrev DecadentLinux...@decadence.org:
> John Larkin <jla...@highlandSNIPMEtechnology.com> wrote in > news:ifsgqhp406799vf7l...@4ax.com: > > > > > > Given a folder C:\Protos, I want a batch file to find all > > sub-folders, possibly a few levels deep, called OLD, and delete > > all of them. I can't make that work. > > > > When we develop a prototype PCB, we name iterations board1, > > board2, etc, and drag the old ones into an OLD folder until it's > > done. Spice folders get a OLD sub-folder too. > > > > Windows batch files don't make a lot of sense to me. Too many > > ambiguities. > > > > For example, > > > > C:\Protos\Z540_P940_Load_Board\PCB\OLD > > > > is full of obsolete iterations. > Windows 10 allows one to have a Linux session within windows. > Linux batch scripting is far more advanced. > > It might not like the NTFS thing though.
WSL is fully integrated with windows, just cd to \mnt\c in linux
Reply by December 26, 20222022-12-26
John Larkin <jlarkin@highlandSNIPMEtechnology.com> wrote in
news:ifsgqhp406799vf7lse21fi8ep2ubgvh9b@4ax.com: 

> > > Given a folder C:\Protos, I want a batch file to find all > sub-folders, possibly a few levels deep, called OLD, and delete > all of them. I can't make that work. > > When we develop a prototype PCB, we name iterations board1, > board2, etc, and drag the old ones into an OLD folder until it's > done. Spice folders get a OLD sub-folder too. > > Windows batch files don't make a lot of sense to me. Too many > ambiguities. > > For example, > > C:\Protos\Z540_P940_Load_Board\PCB\OLD > > is full of obsolete iterations.
Windows 10 allows one to have a Linux session within windows. Linux batch scripting is far more advanced. It might not like the NTFS thing though. You could use it to establish a list, which a Windows Power Shell batch file then uses for the deletion task.
Reply by Martin Brown December 26, 20222022-12-26
On 25/12/2022 23:16, Cydrome Leader wrote:
> John Larkin <jlarkin@highlandsnipmetechnology.com> wrote: >> >> >> Given a folder C:\Protos, I want a batch file to find all sub-folders, >> possibly a few levels deep, called OLD, and delete all of them. I >> can't make that work. >> >> When we develop a prototype PCB, we name iterations board1, board2, >> etc, and drag the old ones into an OLD folder until it's done. Spice >> folders get a OLD sub-folder too. >> >> Windows batch files don't make a lot of sense to me. Too many >> ambiguities. >> >> For example, >> >> C:\Protos\Z540_P940_Load_Board\PCB\OLD >> >> is full of obsolete iterations. > > start with this to get the list of dirs to delete > > cd c:\Protos > > dir /AD OLD /s /B > > you may need a lowercase b, you never mentioned what version of windows you're running.
ITYM dir /ad .\old /s /b >badbatch.txt Otherwise it will falsely match things like bold cold fold folder told I think my search pattern is safe buit may still catch things you don't want to be zapped so double check its output! Then edlin badbatch.txt r/C:/del C:/ w q I'd check it out manually first - my edlin is a little rusty. (and I bet edlin won't run on modern Windoze PCs) It is basically just to tack "del " on the front of each line. -- Regards, Martin Brown
Reply by Ricky December 25, 20222022-12-25
On Sunday, December 25, 2022 at 6:16:13 PM UTC-5, Cydrome Leader wrote:
> John Larkin <jla...@highlandsnipmetechnology.com> wrote: > > > > > > Given a folder C:\Protos, I want a batch file to find all sub-folders, > > possibly a few levels deep, called OLD, and delete all of them. I > > can't make that work. > > > > When we develop a prototype PCB, we name iterations board1, board2, > > etc, and drag the old ones into an OLD folder until it's done. Spice > > folders get a OLD sub-folder too. > > > > Windows batch files don't make a lot of sense to me. Too many > > ambiguities. > > > > For example, > > > > C:\Protos\Z540_P940_Load_Board\PCB\OLD > > > > is full of obsolete iterations. > start with this to get the list of dirs to delete > > cd c:\Protos > > dir /AD OLD /s /B > > you may need a lowercase b, you never mentioned what version of windows you're running.
Probably 3.0. He wants to upgrade to 3.1 to use USB, but can't find a Floppy drive that's not USB. lol -- Rick C. - Get 1,000 miles of free Supercharging - Tesla referral code - https://ts.la/richard11209
Reply by Cydrome Leader December 25, 20222022-12-25
John Larkin <jlarkin@highlandsnipmetechnology.com> wrote:
> > > Given a folder C:\Protos, I want a batch file to find all sub-folders, > possibly a few levels deep, called OLD, and delete all of them. I > can't make that work. > > When we develop a prototype PCB, we name iterations board1, board2, > etc, and drag the old ones into an OLD folder until it's done. Spice > folders get a OLD sub-folder too. > > Windows batch files don't make a lot of sense to me. Too many > ambiguities. > > For example, > > C:\Protos\Z540_P940_Load_Board\PCB\OLD > > is full of obsolete iterations.
start with this to get the list of dirs to delete cd c:\Protos dir /AD OLD /s /B you may need a lowercase b, you never mentioned what version of windows you're running.
Reply by John Larkin December 25, 20222022-12-25
On Sun, 25 Dec 2022 11:35:12 -0800 (PST), Lasse Langwadt Christensen
<langwadt@fonz.dk> wrote:

>s&#4294967295;ndag den 25. december 2022 kl. 17.04.20 UTC+1 skrev John Larkin: >> Given a folder C:\Protos, I want a batch file to find all sub-folders, >> possibly a few levels deep, called OLD, and delete all of them. I >> can't make that work. >> >> When we develop a prototype PCB, we name iterations board1, board2, >> etc, and drag the old ones into an OLD folder until it's done. Spice >> folders get a OLD sub-folder too. >> >> Windows batch files don't make a lot of sense to me. Too many >> ambiguities. >> >> For example, >> >> C:\Protos\Z540_P940_Load_Board\PCB\OLD >> >> is full of obsolete iterations. > >https://code.adonline.id.au/powershell-delete-folders-based-on-name/ > >?
Yikes. Maybe I'll just have someone do it. I could write a PowerBasic program, I guess.
Reply by Lasse Langwadt Christensen December 25, 20222022-12-25
s&oslash;ndag den 25. december 2022 kl. 17.04.20 UTC+1 skrev John Larkin:
> Given a folder C:\Protos, I want a batch file to find all sub-folders, > possibly a few levels deep, called OLD, and delete all of them. I > can't make that work. > > When we develop a prototype PCB, we name iterations board1, board2, > etc, and drag the old ones into an OLD folder until it's done. Spice > folders get a OLD sub-folder too. > > Windows batch files don't make a lot of sense to me. Too many > ambiguities. > > For example, > > C:\Protos\Z540_P940_Load_Board\PCB\OLD > > is full of obsolete iterations.
https://code.adonline.id.au/powershell-delete-folders-based-on-name/ ?
Reply by John May December 25, 20222022-12-25
On Sunday, December 25, 2022 at 4:04:20 PM UTC, John Larkin wrote:
> Given a folder C:\Protos, I want a batch file to find all sub-folders, > possibly a few levels deep, called OLD, and delete all of them. I > can't make that work. > > When we develop a prototype PCB, we name iterations board1, board2, > etc, and drag the old ones into an OLD folder until it's done. Spice > folders get a OLD sub-folder too. > > Windows batch files don't make a lot of sense to me. Too many > ambiguities. > > For example, > > C:\Protos\Z540_P940_Load_Board\PCB\OLD > > is full of obsolete iterations.
Download XYplorer, it can find and list named files or directories starting from any location. It is one of the alternative to the standard windows file manager, and I would think most of the others also have this capability.