Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 68,031 of 68,980    |
|    Accu Backup to John    |
|    Re: Problems Listing Certain Filetypes W    |
|    22 Mar 23 05:22:05    |
      From: accubackup1@gmail.com              On Tuesday, March 21, 2023 at 5:16:17 PM UTC-4, Kerr-Mudd, John wrote:       > On Tue, 21 Mar 2023 16:55:21 -0400        > Zaidy036 wrote:        >        > > On 3/21/2023 3:31 PM, Kerr-Mudd, John wrote:        > > > On Tue, 21 Mar 2023 12:08:44 -0700 (PDT)        > > > Accu Backup wrote:        > > >        > > >> I'm trying to output a list of all .txt and .csv files located within a       certain directory and all its subdirectories. On Windows Server 2019, I'm       running...        > > >>        > > >> C:\>dir "e:\shareddata\folder1\folder2" \*.txt \*.csv \s \b >       "c:\users\username\desktop\output.txt"        > > >>        > > >> or similar variants and getting mixed results. When I have the \s       included, I am getting ALL files... not just the ones I want. I also got only       the wanted files but on the entire drive... not just from the folder I need.       What am I missing here? My        goal is to review the list of files and then use a similar batch to delete       them if there is nothing I need to keep. Thanks.        > > >        > > > Your option slashes are the wrong way round! Untested:        > > >        > > > dir "e:\shareddata\folder1\folder2" \*.txt \*.csv /s /b        > > >        > > Besides the error mentioned I am confused by the \*. usage. Is that a        > > server method or did you mean to use some form of "FOR" and that is a        > > shorthand?        > >        > > In Windows batch:        > > FOR %f IN (txt csv) DO DIR "e:\shareddata\folder1\folder2\*.%f" /S /B        > > -or-        > > DIR "e:\shareddata\folder1\folder2\*.txt" /S /B        > > DIR "e:\shareddata\folder1\folder2\*.csv" /S /B       > That looks much better!       > --        > Bah, and indeed Humbug.       Thank you for the help. The \*. usage I found here...       https://www.howtogeek.com/363639/how-to-use-the-dir-command-in-windows/       near the end of the article. This is working. How can I modify these to       DELETE the found files and EXCLUDE found files that may be in certain       sub-folders in this directory? For example, this folder has many folders       named Methods within it and I may        not want to delete .txt files that are found in any Methods folder.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca