• Is there ANY way in DOS to rmdir a tree using wildcards?

    From SPAMBLOCKER@SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com (Spammay Blockay) to comp.os.ms-windows.misc on Wednesday, July 30, 2003 19:03:42
    From Newsgroup: comp.os.ms-windows.misc

    I notice that the DOS rmdir doesn't allow you to give it
    the '*' wildcard as an argument. What does one do when one
    needs to remove a bunch of directories if one doesn't know
    their name, and do it in DOS?

    - Tim

    --

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Andreas Koch@mail@kochandreas.com to comp.os.ms-windows.misc on Wednesday, July 30, 2003 22:31:58
    From Newsgroup: comp.os.ms-windows.misc

    Spammay Blockay wrote:
    I notice that the DOS rmdir doesn't allow you to give it
    the '*' wildcard as an argument. What does one do when one
    needs to remove a bunch of directories if one doesn't know
    their name, and do it in DOS?

    You could try using the FOR command:

    for (%f in tmp*) do rmdir %f

    --
    Andreas
    He screamed: THIS IS SIG!

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From SPAMBLOCKER@SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com (Spammay Blockay) to comp.os.ms-windows.misc on Wednesday, July 30, 2003 21:37:52
    From Newsgroup: comp.os.ms-windows.misc

    In article <bg99uj$3o6$06$1@news.t-online.com>,
    Andreas Koch <mail@kochandreas.com> wrote:
    Spammay Blockay wrote:
    I notice that the DOS rmdir doesn't allow you to give it
    the '*' wildcard as an argument. What does one do when one
    needs to remove a bunch of directories if one doesn't know
    their name, and do it in DOS?

    You could try using the FOR command:

    for (%f in tmp*) do rmdir %f

    I just tried that, but I need to be able to use other
    environment variables in the script, which Command.com
    doesn't seem to like... that is:

    SET MYDIR=C:\a\b\c
    FOR %F IN (%MYDIR%\PATTERN*) DO RMDIR %f

    ... doesn't work, because it doesn't seem to like %MYDIR%
    in the FOR command. Any way around this you know of?

    - Tim

    --

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Phil D@dindak@nortelnutworks.com to comp.os.ms-windows.misc on Thursday, July 31, 2003 08:46:29
    From Newsgroup: comp.os.ms-windows.misc

    use deltree

    http://www.computerhope.com/deltree.htm



    On Wed, 30 Jul 2003 19:03:42 GMT, SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com
    (Spammay Blockay) wrote:

    I notice that the DOS rmdir doesn't allow you to give it
    the '*' wildcard as an argument. What does one do when one
    needs to remove a bunch of directories if one doesn't know
    their name, and do it in DOS?

    - Tim

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Herman D. Knoble@hdk@psu.edu to comp.os.ms-windows.misc on Thursday, July 31, 2003 14:47:22
    From Newsgroup: comp.os.ms-windows.misc

    For Windows NT/2000/XP issue the command: del /?
    See if the /S command will help.
    That is del c:\test\*.* /s will delete all files in c:\test and all c:\test's children
    subdirectories.

    Then issue: rmdir c:\test /s
    to remove the empty folders.

    Skip Knoble, Penn State

    On Thu, 31 Jul 2003 18:06:54 GMT, SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com (Spammay Blockay)
    wrote:

    -|In article <3b7iivkfj6c2kgubi1lkjntea763ivguik@4ax.com>,
    -|Phil D <dindak@nortelnutworks.com> wrote:
    use deltree

    http://www.computerhope.com/deltree.htm
    -|
    -|Doesn't come with Windows 2000. It has to be something that's part
    -|of Win2K already. You'd think they believe in simple shell scripting
    -|sorts of syntaxs... but nooooooooo! :-)
    -|
    -|- Tim
    -|
    On Wed, 30 Jul 2003 19:03:42 GMT, SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com -|>(Spammay Blockay) wrote:

    I notice that the DOS rmdir doesn't allow you to give it
    the '*' wildcard as an argument. What does one do when one
    needs to remove a bunch of directories if one doesn't know
    their name, and do it in DOS?

    - Tim


    Herman D. (Skip) Knoble, Research Associate
    (a computing professional for 38 years)
    Mailto:hdk@psu.edu
    Web: http://www.personal.psu.edu/hdk
    Penn State Information Technology Services
    Academic Services and Emerging Technologies
    Graduate Education and Research Services
    Penn State University
    214C Computer Building
    University Park, PA 16802-21013
    Phone:+1 814 865-0818 Fax:+1 814 863-7049
    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From psc@psc@prairienetX.org to comp.os.ms-windows.misc on Thursday, July 31, 2003 18:51:11
    From Newsgroup: comp.os.ms-windows.misc

    Isn't that what "RMDIR /s <path>" does?

    Bryan

    Spammay Blockay <SPAMBLOCKER@blockedtoavoidspam.com> wrote:
    I notice that the DOS rmdir doesn't allow you to give it
    the '*' wildcard as an argument. What does one do when one
    needs to remove a bunch of directories if one doesn't know
    their name, and do it in DOS?

    - Tim

    --

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From SPAMBLOCKER@SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com (Spammay Blockay) to comp.os.ms-windows.misc on Thursday, July 31, 2003 18:59:27
    From Newsgroup: comp.os.ms-windows.misc

    In article <fvoiivs6i1hf80aiei7ca6ggpe84a9ov4q@4ax.com>,
    Herman D. Knoble <hdk@psu.edu> wrote:
    For Windows NT/2000/XP issue the command: del /?
    See if the /S command will help.
    That is del c:\test\*.* /s will delete all files in c:\test and all c:\test's children
    subdirectories.

    Then issue: rmdir c:\test /s
    to remove the empty folders.

    Thanks for your help, Herman, but I think I may not have
    made myself clear.

    In this case, I have a directory stored in the variable
    name %MYDIR%. In %MYDIR% there exists a bunch of files,
    and some directories, who's names I do not know.

    I need to delete all the subdirectories in %MYDIR%,
    and all the files in those subdirectories (ie. the
    entire directory tree of each of these directories),
    BUT NOT ANY OTHER FILE in %MYDIR%.

    So, if I've got:

    %MYDIR%\myFile1.txt
    %MYDIR%\myFile2.cmd
    %MYDIR%\myDir1\file1.txt
    %MYDIR%\myDir2\abc

    Then the directory trees %MYDIR%\myDir1 and %MYDIR%\myDir2
    should be deleted, but nothing else.

    Any way you can think of doing this in a batch file?

    - Tim


    --

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From SPAMBLOCKER@SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com (Spammay Blockay) to comp.os.ms-windows.misc on Thursday, July 31, 2003 19:02:16
    From Newsgroup: comp.os.ms-windows.misc

    In article <bgboev$bnp$1@wildfire.prairienet.org>,
    <psc@prairienetX.org> wrote:
    Isn't that what "RMDIR /s <path>" does?

    Nope, RMDIR doesn't recognize wildcards -- witness:

    C:\>mkdir TESTDIR

    C:\>cd TESTDIR

    C:\TESTDIR>mkdir A

    C:\TESTDIR>mkdir B

    C:\TESTDIR>dir
    Volume in drive C is Local Disk
    Volume Serial Number is 7CD1-879E

    Directory of C:\TESTDIR

    07/31/2003 12:00p <DIR> .
    07/31/2003 12:00p <DIR> ..
    07/31/2003 12:00p <DIR> A
    07/31/2003 12:00p <DIR> B
    0 File(s) 0 bytes
    4 Dir(s) 25,187,280,384 bytes free

    C:\TESTDIR>rmdir /s *
    *, Are you sure (Y/N)? y
    The filename, directory name, or volume label syntax is incorrect.

    C:\TESTDIR>

    Any other ideas?

    - Tim

    Bryan

    Spammay Blockay <SPAMBLOCKER@blockedtoavoidspam.com> wrote:
    I notice that the DOS rmdir doesn't allow you to give it
    the '*' wildcard as an argument. What does one do when one
    needs to remove a bunch of directories if one doesn't know
    their name, and do it in DOS?

    - Tim

    --



    --

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Andreas Koch@mail@kochandreas.com to comp.os.ms-windows.misc on Thursday, July 31, 2003 21:19:38
    From Newsgroup: comp.os.ms-windows.misc

    Spammay Blockay wrote:

    I need to delete all the subdirectories in %MYDIR%,
    and all the files in those subdirectories (ie. the
    entire directory tree of each of these directories),
    BUT NOT ANY OTHER FILE in %MYDIR%.

    Mhhh... is backing up the files, deleting files
    and directories, then copying the files back
    an option?

    Is Windows Scripting Host (should be in 2K) an
    Option?



    --
    Andreas
    He screamed: THIS IS SIG!

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From SPAMBLOCKER@SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com (Spammay Blockay) to comp.os.ms-windows.misc on Thursday, July 31, 2003 19:22:28
    From Newsgroup: comp.os.ms-windows.misc

    In article <bgbq2s$a86$06$1@news.t-online.com>,
    Andreas Koch <mail@kochandreas.com> wrote:
    Spammay Blockay wrote:

    I need to delete all the subdirectories in %MYDIR%,
    and all the files in those subdirectories (ie. the
    entire directory tree of each of these directories),
    BUT NOT ANY OTHER FILE in %MYDIR%.

    Mhhh... is backing up the files, deleting files
    and directories, then copying the files back
    an option?

    I tried using MOVE to move the directories to a known
    place, and even that didn't understand wildcards
    the way I need it to. Is that what you're suggesting?

    Is Windows Scripting Host (should be in 2K) an
    Option?

    Don't know that -- does that require writing in VBScript?

    - Tim

    --

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From psc@psc@prairienetX.org to comp.os.ms-windows.misc on Thursday, July 31, 2003 20:35:22
    From Newsgroup: comp.os.ms-windows.misc

    Actually, I was suggesting for your example "rmdir /s TESTDIR", but I see
    in a leter post you need to preserve TESTDIR and any files in TESTDIR. My suggestion gets rid of them as well. Sotty, that's all I have.

    Bryan

    Spammay Blockay <SPAMBLOCKER@blockedtoavoidspam.com> wrote:
    In article <bgboev$bnp$1@wildfire.prairienet.org>,
    <psc@prairienetX.org> wrote:
    Isn't that what "RMDIR /s <path>" does?

    Nope, RMDIR doesn't recognize wildcards -- witness:

    C:\>mkdir TESTDIR

    C:\>cd TESTDIR

    C:\TESTDIR>mkdir A

    C:\TESTDIR>mkdir B

    C:\TESTDIR>dir
    Volume in drive C is Local Disk
    Volume Serial Number is 7CD1-879E

    Directory of C:\TESTDIR

    07/31/2003 12:00p <DIR> .
    07/31/2003 12:00p <DIR> ..
    07/31/2003 12:00p <DIR> A
    07/31/2003 12:00p <DIR> B
    0 File(s) 0 bytes
    4 Dir(s) 25,187,280,384 bytes free

    C:\TESTDIR>rmdir /s *
    *, Are you sure (Y/N)? y
    The filename, directory name, or volume label syntax is incorrect.

    C:\TESTDIR>

    Any other ideas?

    - Tim

    Bryan

    Spammay Blockay <SPAMBLOCKER@blockedtoavoidspam.com> wrote:
    I notice that the DOS rmdir doesn't allow you to give it
    the '*' wildcard as an argument. What does one do when one
    needs to remove a bunch of directories if one doesn't know
    their name, and do it in DOS?

    - Tim

    --



    --

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From SPAMBLOCKER@SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com (Spammay Blockay) to comp.os.ms-windows.misc on Thursday, July 31, 2003 20:37:42
    From Newsgroup: comp.os.ms-windows.misc

    In article <bgbuia$djs$3@wildfire.prairienet.org>,
    <psc@prairienetX.org> wrote:
    Actually, I was suggesting for your example "rmdir /s TESTDIR", but I see
    in a leter post you need to preserve TESTDIR and any files in TESTDIR. My >suggestion gets rid of them as well. Sotty, that's all I have.

    Bryan

    Oh well, thanks anyway -- I hope someone out there knows the
    answer (or if there IS an answer :-) ).

    - Tim

    Spammay Blockay <SPAMBLOCKER@blockedtoavoidspam.com> wrote:
    In article <bgboev$bnp$1@wildfire.prairienet.org>,
    <psc@prairienetX.org> wrote:
    Isn't that what "RMDIR /s <path>" does?

    Nope, RMDIR doesn't recognize wildcards -- witness:

    C:\>mkdir TESTDIR

    C:\>cd TESTDIR

    C:\TESTDIR>mkdir A

    C:\TESTDIR>mkdir B

    C:\TESTDIR>dir
    Volume in drive C is Local Disk
    Volume Serial Number is 7CD1-879E

    Directory of C:\TESTDIR

    07/31/2003 12:00p <DIR> .
    07/31/2003 12:00p <DIR> ..
    07/31/2003 12:00p <DIR> A
    07/31/2003 12:00p <DIR> B
    0 File(s) 0 bytes
    4 Dir(s) 25,187,280,384 bytes free

    C:\TESTDIR>rmdir /s *
    *, Are you sure (Y/N)? y
    The filename, directory name, or volume label syntax is incorrect.

    C:\TESTDIR>

    Any other ideas?

    - Tim

    Bryan

    Spammay Blockay <SPAMBLOCKER@blockedtoavoidspam.com> wrote:
    I notice that the DOS rmdir doesn't allow you to give it
    the '*' wildcard as an argument. What does one do when one
    needs to remove a bunch of directories if one doesn't know
    their name, and do it in DOS?

    - Tim

    --



    --



    --

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Phil Robyn@zipprobyn@uclink.berkeley.edu to comp.os.ms-windows.misc on Thursday, July 31, 2003 19:29:16
    From Newsgroup: comp.os.ms-windows.misc

    Spammay Blockay wrote:

    In article <bgbuia$djs$3@wildfire.prairienet.org>,
    <psc@prairienetX.org> wrote:

    Actually, I was suggesting for your example "rmdir /s TESTDIR", but I see >>in a leter post you need to preserve TESTDIR and any files in TESTDIR. My >>suggestion gets rid of them as well. Sotty, that's all I have.

    Bryan


    Oh well, thanks anyway -- I hope someone out there knows the
    answer (or if there IS an answer :-) ).

    - Tim

    - - - - - - - - - - begin screen capture - - - - - - - - - -
    <Win2000> c:\cmd>tree d:\junkdir
    Directory PATH listing for volume MICRON
    Volume serial number is 0012FC94 784B:893D
    D:\JUNKDIR
    ????profiles
    ? ????user1
    ? ????user2
    ? ????user3
    ? ????user4
    ????suba
    ????subb
    ????subc

    <Win2000> c:\cmd>for /f "tokens=*" %a in ('dir /ad /b d:\junkdir') do @echo remove d:\junkdir\%a /s /q
    remove d:\junkdir\profiles /s /q
    remove d:\junkdir\suba /s /q
    remove d:\junkdir\subb /s /q
    remove d:\junkdir\subc /s /q
    - - - - - - - - - - end screen capture - - - - - - - - - -

    If this appears to do what you want, then change '@echo remove' to 'rd'.
    You may also have to add a pair of double quotes if any of your directory
    names have spaces.


    Spammay Blockay <SPAMBLOCKER@blockedtoavoidspam.com> wrote:

    In article <bgboev$bnp$1@wildfire.prairienet.org>,
    <psc@prairienetX.org> wrote:

    Isn't that what "RMDIR /s <path>" does?

    Nope, RMDIR doesn't recognize wildcards -- witness:

    C:\>mkdir TESTDIR

    C:\>cd TESTDIR

    C:\TESTDIR>mkdir A

    C:\TESTDIR>mkdir B

    C:\TESTDIR>dir
    Volume in drive C is Local Disk
    Volume Serial Number is 7CD1-879E

    Directory of C:\TESTDIR

    07/31/2003 12:00p <DIR> .
    07/31/2003 12:00p <DIR> ..
    07/31/2003 12:00p <DIR> A
    07/31/2003 12:00p <DIR> B
    0 File(s) 0 bytes
    4 Dir(s) 25,187,280,384 bytes free

    C:\TESTDIR>rmdir /s *
    *, Are you sure (Y/N)? y
    The filename, directory name, or volume label syntax is incorrect.

    C:\TESTDIR>

    Any other ideas?

    - Tim

    Bryan

    Spammay Blockay <SPAMBLOCKER@blockedtoavoidspam.com> wrote:

    I notice that the DOS rmdir doesn't allow you to give it
    the '*' wildcard as an argument. What does one do when one
    needs to remove a bunch of directories if one doesn't know
    their name, and do it in DOS?

    - Tim

    --



    --






    --
    Phil Robyn
    Univ. of California, Berkeley

    u n z i p m y a d d r e s s t o s e n d e - m a i l

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Spalls Hurgenson@yoinks@ebalu.com to comp.os.ms-windows.misc on Friday, August 01, 2003 02:48:05
    From Newsgroup: comp.os.ms-windows.misc

    On Thu, 31 Jul 2003 18:59:27 GMT, SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com
    (Spammay Blockay) wrote:

    In article <fvoiivs6i1hf80aiei7ca6ggpe84a9ov4q@4ax.com>,
    Herman D. Knoble <hdk@psu.edu> wrote:
    For Windows NT/2000/XP issue the command: del /?
    See if the /S command will help.
    That is del c:\test\*.* /s will delete all files in c:\test and all c:\test's children
    subdirectories.

    Then issue: rmdir c:\test /s
    to remove the empty folders.

    Thanks for your help, Herman, but I think I may not have
    made myself clear.

    In this case, I have a directory stored in the variable
    name %MYDIR%. In %MYDIR% there exists a bunch of files,
    and some directories, who's names I do not know.

    I need to delete all the subdirectories in %MYDIR%,
    and all the files in those subdirectories (ie. the
    entire directory tree of each of these directories),
    BUT NOT ANY OTHER FILE in %MYDIR%.

    So, if I've got:

    %MYDIR%\myFile1.txt
    %MYDIR%\myFile2.cmd
    %MYDIR%\myDir1\file1.txt
    %MYDIR%\myDir2\abc

    Then the directory trees %MYDIR%\myDir1 and %MYDIR%\myDir2
    should be deleted, but nothing else.

    Any way you can think of doing this in a batch file?


    If I'm understanding you correctly, you want to keep all the files in
    the folder and just delete all the directories. If you don't want to
    delete all the directories, or only want to delete directories that
    have certain letters in their name (e.g., delete \PORN001, \PORN002,
    \P0RN003 but not \LETTERSTOGRANDMA ;) then this would be a different
    story...

    So, how about a simple batch file where you move the files to a
    temporary location, then DELTREE the remaining contents of the folder?

    E.g.,

    MD C:\TEMPCOPY
    XCOPY C:\MYDIR\*.* C:\TEMPCOPY
    DELTREE C:\MYDIR\
    XCOPY C:\TEMPCOPY\*.* C:\MYDIR

    (if you don't have DELTREE, you could go use instead:

    CD..
    RMDIR C:\MYDIR
    MD C:\MYDIR
    CD C:\MYDIR

    Of course, this is not an optimal solution; if you have a large number
    of files the copies could take a long time, and various file
    attributes (hidden, system, readonly) might cause problems... but it
    doesn't seem to be the simplest.


    - Tim

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Herman D. Knoble@hdk@psu.edu to comp.os.ms-windows.misc on Friday, August 01, 2003 08:33:10
    From Newsgroup: comp.os.ms-windows.misc

    You can issue:

    cd \
    cd testdir
    attrib +R *.* (make the files i testdir read only.)
    del *.* /s /q (this will erase all files in A and B
    attrib -R *.* (remove the Read Only bit)

    Now A and B are empty and testdir files are ok.
    Removing just these children subdirectories IA and B) is another matter.

    Assuming that all files in Testdir have a file extension, and that no directries
    under c:\testdir have extensions, one could issue:

    CD \
    cd testdir
    dir /b *. > delthem.bat

    Now delthem .bat would contain only subdirectoy names for subdirecties
    under c:\testdir.

    One could then edit this file using edlin (or even notepad) and insert before each line
    the three characters 'rd ' (wiithout quotes), and then run: delthem.bat

    Crude, but works.

    Skip Knoble, Penn State


    On Thu, 31 Jul 2003 20:37:42 GMT, SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com (Spammay Blockay)
    wrote:

    -|In article <bgbuia$djs$3@wildfire.prairienet.org>,
    -| <psc@prairienetX.org> wrote:
    Actually, I was suggesting for your example "rmdir /s TESTDIR", but I see -|>in a leter post you need to preserve TESTDIR and any files in TESTDIR. My -|>suggestion gets rid of them as well. Sotty, that's all I have.

    Bryan
    -|
    -|Oh well, thanks anyway -- I hope someone out there knows the
    -|answer (or if there IS an answer :-) ).
    -|
    -|- Tim
    -|
    Spammay Blockay <SPAMBLOCKER@blockedtoavoidspam.com> wrote:
    In article <bgboev$bnp$1@wildfire.prairienet.org>,
    <psc@prairienetX.org> wrote:
    Isn't that what "RMDIR /s <path>" does?

    Nope, RMDIR doesn't recognize wildcards -- witness:

    C:\>mkdir TESTDIR

    C:\>cd TESTDIR

    C:\TESTDIR>mkdir A

    C:\TESTDIR>mkdir B

    C:\TESTDIR>dir
    Volume in drive C is Local Disk
    Volume Serial Number is 7CD1-879E

    Directory of C:\TESTDIR

    07/31/2003 12:00p <DIR> .
    07/31/2003 12:00p <DIR> ..
    07/31/2003 12:00p <DIR> A
    07/31/2003 12:00p <DIR> B
    0 File(s) 0 bytes
    4 Dir(s) 25,187,280,384 bytes free

    C:\TESTDIR>rmdir /s *
    *, Are you sure (Y/N)? y
    The filename, directory name, or volume label syntax is incorrect.

    C:\TESTDIR>

    Any other ideas?

    - Tim

    Bryan

    Spammay Blockay <SPAMBLOCKER@blockedtoavoidspam.com> wrote:
    I notice that the DOS rmdir doesn't allow you to give it
    the '*' wildcard as an argument. What does one do when one
    needs to remove a bunch of directories if one doesn't know
    their name, and do it in DOS?

    - Tim

    --



    --



    Herman D. (Skip) Knoble, Research Associate
    (a computing professional for 38 years)
    Mailto:hdk@psu.edu
    Web: http://www.personal.psu.edu/hdk
    Penn State Information Technology Services
    Academic Services and Emerging Technologies
    Graduate Education and Research Services
    Penn State University
    214C Computer Building
    University Park, PA 16802-21013
    Phone:+1 814 865-0818 Fax:+1 814 863-7049
    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Spalls Hurgenson@yoinks@ebalu.com to comp.os.ms-windows.misc on Friday, August 01, 2003 13:52:35
    From Newsgroup: comp.os.ms-windows.misc

    On Fri, 01 Aug 2003 05:32:07 GMT, SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com
    (Spammay Blockay) wrote:

    I don't know if you've read my other postings, but the solution

    Some, not all (odd propogation on this server ;-)

    requires that the deleting mechanism be able to use environment
    variables and wildcards. DELTREE can do this, but I'm using Windows 2000, >which doesn't come with it.



    Then get it?
    http://www.techadvice.cc/files/s29k2/w95b/deltree.exe


    And you can't do:

    rmdir %MYVARIABLE%\*

    Just try it under Windows 2000, and you'll see that rmdir doesn't
    understand wildcards.

    Hmm, under WindowsXP,

    rmdir %MYDIR%\
    or
    rmdir %MYDIR%\TEST\

    both work. Don't forget the trailing slash. But perhaps 2K's rmdir
    does things differently.

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From SPAMBLOCKER@SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com (Spammay Blockay) to comp.os.ms-windows.misc on Friday, August 01, 2003 17:00:19
    From Newsgroup: comp.os.ms-windows.misc

    In article <eerkivk7isfnnh2g7dda5dl7drp6rd3ocu@4ax.com>,
    Spalls Hurgenson <there> wrote:
    On Fri, 01 Aug 2003 05:32:07 GMT, SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com
    (Spammay Blockay) wrote:

    I don't know if you've read my other postings, but the solution

    Some, not all (odd propogation on this server ;-)

    requires that the deleting mechanism be able to use environment
    variables and wildcards. DELTREE can do this, but I'm using Windows 2000, >>which doesn't come with it.

    Then get it?
    http://www.techadvice.cc/files/s29k2/w95b/deltree.exe

    I was hoping to not have to add anything... it's supposed to work
    without adding any new .exe's.

    And you can't do:

    rmdir %MYVARIABLE%\*

    Just try it under Windows 2000, and you'll see that rmdir doesn't >>understand wildcards.

    Hmm, under WindowsXP,

    rmdir %MYDIR%\
    or
    rmdir %MYDIR%\TEST\

    both work. Don't forget the trailing slash. But perhaps 2K's rmdir
    does things differently.

    Did you try:

    rmdir %MYDIR%\*

    ??

    I'll see if adding a trailing slash makes a difference, tho'.

    - Tim

    --

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From SPAMBLOCKER@SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com (Spammay Blockay) to comp.os.ms-windows.misc on Friday, August 01, 2003 18:31:11
    From Newsgroup: comp.os.ms-windows.misc

    In article <rpmkivo2bfbgku6den4psisffqgvnchl1v@4ax.com>,
    Herman D. Knoble <hdk@psu.edu> wrote:
    You can issue:

    cd \
    cd testdir
    attrib +R *.* (make the files i testdir read only.)
    del *.* /s /q (this will erase all files in A and B
    attrib -R *.* (remove the Read Only bit)

    Now A and B are empty and testdir files are ok.
    Removing just these children subdirectories IA and B) is another matter.

    Assuming that all files in Testdir have a file extension, and that no directries
    under c:\testdir have extensions, one could issue:

    CD \
    cd testdir
    dir /b *. > delthem.bat

    Now delthem .bat would contain only subdirectoy names for subdirecties
    under c:\testdir.

    One could then edit this file using edlin (or even notepad) and insert before each line
    the three characters 'rd ' (wiithout quotes), and then run: delthem.bat

    Crude, but works.

    Aaaaaaaaarrrgh! I've been spoiled by being an old unix hack!

    Bad, BAD DOS! Need to be able to do: rm -fr $mydir/pattern*

    Grrr. :-)

    - Tim

    --

    --- Synchronet 3.18b-Win32 NewsLink 1.113
  • From Spalls Hurgenson@yoinks@ebalu.com to comp.os.ms-windows.misc on Saturday, August 02, 2003 03:04:47
    From Newsgroup: comp.os.ms-windows.misc

    On Fri, 01 Aug 2003 17:00:19 GMT, SPAMBLOCKER@BLOCKEDTOAVOIDSPAM.com
    (Spammay Blockay) wrote:

    Did you try:

    rmdir %MYDIR%\*

    Yes. Specifically, I created and filled the folder C:\TEMP\TEST with a
    number of garbage files and directories. I then SET MYDIR=C:\TEMP\TEST

    This I followed with the command RMDIR /S /Q %MYDIR%\ . This
    successfully deleted C:\TEMP\TEST and all its contents. The /S command
    is required to delete all contents, the /Q makes it work quietly,
    without asking for confirmation. Without the /S command, RMDIR will
    complain that the directory is not empty

    As I said, this was in WinXP (Pro, SP1); it's possible RMDIR works
    differently in Win2K.

    Of course, after RMDIR the directory, you'd have to recreate it and
    then copy the files you wanted to save back from the temp folder you
    made...


    I'll see if adding a trailing slash makes a difference, tho'.

    Be sure to let us know how it turns out, if only to confirm whether or
    not Win2K's RMDIR works differently.

    --- Synchronet 3.18b-Win32 NewsLink 1.113