Electronics-Related.com
Forums

Windows batch file help

Started by John Larkin December 25, 2022
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
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.
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