Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: help for my batch  (Read 3149 times)

0 Members and 1 Guest are viewing this topic.

dirkaulo

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Windows 7
    help for my batch
    « on: January 13, 2016, 03:33:47 AM »
    Hi,

    I am writing a simple script.
    My aim is to copy every files in "C:\test\source" to "C:\test\destination".
    And for every 7 files copied, I would like to sleep 20 seconds.
    I have been trying so hard but it still fails.
    Can anyone help?
    Thanks a lot!


    @ECHO OFF
    ECHO.

    set i=0

    for /f %%f in ('dir /b C:\test\source') do (
       %i%=%i%++
       move /y file C:\test\destination
       if "%i%" %% 7 =="0" (
       echo "Copied and sleep now"
       sleep 20
       ) else (
       echo "Copied"
       )
       )

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: help for my batch
    « Reply #1 on: January 13, 2016, 04:35:20 AM »
    This is posted on Dostips also, where I gave advice to read the help for /a in the set command.