Results 1 to 3 of 3

Thread: Batch File Help

  1. #1

    Batch File Help

    I've been spending hours on end trying to figure out this batch file. What I'm trying to do is copy contents of a folder into another folder one at a time.

    Here are the contents of the batch file right now:
    @echo off
    set CurrentPath="C:\current\"
    set BackUps="C:\BackUps\"
    for /f %%R in ("dir/s/b/ad %BackUps%") do %%R
    rem call :1 %%R
    goto :eof
    echo %1>Done.txt
    If you open up Done.txt once the batch file has completed running it has this in the file: dir/s/b/ad

    Which is the command ran to get the sub directories in the directory I specified.

    Can anyone help me figure out how to get the sub directories name into the file?

  2. #2
    Join Date
    Mar 2002
    Why not just use:

    xcopy C:\current\*.* c:\Backup\*.* /s /v

    Seems a whole lot simpler (/s copies subdirectories too, /v verifies the copy).
    Chris at
    Windows & Linux hosting and fully managed dedicated servers with great customer service!
    UK-based but serving the world...

  3. #3
    Not what I'm trying to do. I finally figure it out. Here's what I've done:
    for /F %%R in ('dir /ad /b /p %BackUps%') do call :1 %%R

Posting Permissions

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