1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Batch file help

Discussion in 'Windows XP' started by Sarsum, 2008/10/07.

  1. 2008/10/07
    Sarsum

    Sarsum Inactive Thread Starter

    Joined:
    2008/10/07
    Messages:
    3
    Likes Received:
    0
    I got this problem with a batch file that i cant solve. Plz help me.
    ______________________________________________________
    @Echo off
    cd data
    cd uroprojekt

    :begin

    rd /s /q %1\

    shift /1

    cd..

    if "%1 "==" " (goto end) else (goto begin)

    :end

    cd..

    cd..
    _____________________
    This batch file needs to delete a selected number from a random folder.:confused:
    It seems that it can find the directory, but because it's a random directory I cant seem to solve this mystery.
    Ty in andvance. The batch can delete the first selected file but if I try to delete multiple files it says that the file is missing.
     
  2. 2008/10/07
    Steve R Jones

    Steve R Jones SuperGeek Staff

    Joined:
    2001/12/30
    Messages:
    12,323
    Likes Received:
    253
    Welcome to WindowsBBS;)

    cd data (this command changes directory to DATA - does that folder exist)
    cd uroprojekt (this command changes directory to DATA\UROPROJEKT - does that folder exist)

    :begin

    rd /s /q %1\ (this command REMOVES DIRECTORY)

    shift /1
     

  3. to hide this advert.

  4. 2008/10/07
    Sarsum

    Sarsum Inactive Thread Starter

    Joined:
    2008/10/07
    Messages:
    3
    Likes Received:
    0
    Re: Batch help

    Theres is one problem more.
    The batch must only, and i quote ONLY delete numerous files at a time, but not them all...
    If i wish to create a folder named lars and folder named peter and a last 1 called charlie, and then i wish to only delete lars and charlie, but maybe some other day i wish to delete peter... How do i do this in a batch file??
     
  5. 2008/10/07
    Sarsum

    Sarsum Inactive Thread Starter

    Joined:
    2008/10/07
    Messages:
    3
    Likes Received:
    0
    RE: batch file

    No worries, problem solved! thanks.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.