Home

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Help with a .bat file

  1. #1
    Lance Reynolds NNTP User

    Help with a .bat file

    Anybody know how to do this??

    <snip>
    Lance ,

    I need a routine that will find and delete any folder ( and what it
    contains) called " old version " or " old versions" is there a way to
    make this a .bat file that i can run every so many days ?
    <snip

  2. #2
    Stevo NNTP User

    Re: Help with a .bat file

    Lance Reynolds scribbled something like:

    > I need a routine that will find and delete any folder ( and what it
    > contains) called " old version " or " old versions" is there a way to
    > make this a .bat file that i can run every so many days ? <snip


    Not sure about getting rid of the actual folder, but the DEL command
    should work for the files in that folder.

    DEL /F /Q "<path to folder>"

  3. #3
    OrangeBlossom NNTP User

    Re: Help with a .bat file

    what about using * in the folder path...

    --
    "Moldy mildew, mother of mouthmuck, dangle and strangle to death." She
    said.

  4. #4
    baljemmett NNTP User

    Re: Help with a .bat file

    Lance Reynolds wrote:
    > I need a routine that will find and delete any folder ( and what it
    > contains) called " old version " or " old versions" is there a way to
    > make this a .bat file that i can run every so many days ?


    Well, you might be able to use something like:

    FOR /R %%D IN (.) DO IF EXIST "%%D\old version" DEL /S "%%D\old version"

    .... that should find any directories called "old version" anywhere
    underneath the current folder, and delete them. I think

    --
    Regards,
    Ben A L Jemmett
    http://flatpack.microwavepizza.co.uk/

  5. #5
    Heff NNTP User

    Re: Help with a .bat file

    To delete all from the root down, try:-

    FOR /F %d IN (`DIR \"old version?" /ad/s/b`) DO RMDIR "%d" /S /Q
    Or to play safe
    FOR /F %d IN (`DIR \"old version" /ad/s/b`) DO RMDIR "%d" /S /Q
    FOR /F %d IN (`DIR \"old versions" /ad/s/b`) DO RMDIR "%d" /S /Q

    Don't forget to double up on the %s when including it in a batch file. i.e.
    use %%d not %d

    Untested, but it should work.


    Heff.


    "Lance Reynolds" <lanceNO@SPAMsatco.biz> wrote in message
    news:6jitj.1546$Ec7.1476@kovat.provo.novell.com...
    > Anybody know how to do this??
    >
    > <snip>
    > Lance ,
    >
    > I need a routine that will find and delete any folder ( and what it
    > contains) called " old version " or " old versions" is there a way to make
    > this a .bat file that i can run every so many days ?
    > <snip




  6. #6
    red_zephrin NNTP User

    Re: Help with a .bat file

    Lance Reynolds wrote:
    > Anybody know how to do this??
    >
    > <snip>
    > Lance ,
    >
    > I need a routine that will find and delete any folder ( and what it
    > contains) called " old version " or " old versions" is there a way to
    > make this a .bat file that i can run every so many days ?
    > <snip

    FDISK?

    Brad

  7. #7
    Join Date
    Sep 2007
    Location
    In a house
    Posts
    0

    Re: Help with a .bat file

    I think this should be asked over in the Batman forums. Just an
    observation though and it may not help as I get hit in the head with a
    bat when I go there.
    --




  8. #8
    Join Date
    Sep 2007
    Location
    In a house
    Posts
    0

    Re: Help with a .bat file

    IEPrivacyKeeper has a function that will delete a folder and it's
    contents.
    --




  9. #9
    Lance Reynolds NNTP User

    Re: Help with a .bat file

    Looks like you're the winner, Ben. Thanks so much!

    And thanks to everyone else for responding...even the FDISK! :-)

    Lance

  10. #10
    Stevo NNTP User

    Re: Help with a .bat file

    Lance Reynolds scribbled something like:

    > Looks like you're the winner, Ben. Thanks so much!


    No fair! Just cuz he's smarter than me. <G>

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •