Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Moving multiple files using batch
Name: trackero Date: January 2, 2009 at 13:59:28 Pacific OS: Windows XP CPU/Ram: Intel Xion Product: Dell / 1950 Subcategory: General
Comment:
Hi folks!
Need some help here. I'm trying to sever thousand files to a directory in sequence of 100 at the time. So I want to copy 100 files first, then wait about 60 seconds to copy the next 100. This is what I got so far:
@echo off
setLocal EnableDelayedExpansion
:START TIMEOUT 60 GO TO LOOP
:LOOP FOR /F "tokens=* delims= " %%i IN ('dir /b ') DO ( set /a N+=1 move "%%i" D:/MYDIRECTORY if !N! geq 100 GOTO START )
::DONE
The first time it goes through fine for the first 100 files. But when it goes back to START, it starts copying one file every 60 seconds. Any help would be appreciated.
Name: IVO Date: January 2, 2009 at 14:35:32 Pacific
Reply:
@echo off & setLocal EnableDelayedExpansion
:LOOP set /A limit+=100 TIMEOUT 60
FOR %%i IN (*) DO ( set /A N+=1 move "%%i" D:/MYDIRECTORY if !N! geq %limit% GOTO :LOOP )
:DONE
0
Response Number 2
Name: IVO Date: January 3, 2009 at 03:11:12 Pacific
Reply:
The following is an enhanced version of the native script without GOTOs and avoiding the initial 60 seconds delay. @echo off & setlocal EnableDelayedExpansion
set LIM=100 for %%i in (*) do ( set /A N+=1 move "%%i" D:/MYDIRECTORY if !N! geq !LIM! (TimeOut 60 & set /A LIM+=100) ) :DONE
0
Response Number 3
Name: trackero Date: January 3, 2009 at 14:15:43 Pacific
Summary: hi all I want to create a batch file for rename multiple files , or rename only a part of file name for examples: original: 01-one.txt 02-five.txt rename in: one.txt five.txt . I have many files thank...
Summary: Hi, Can someone help me in creating a batch file which will created multiple files of any extension at specified location, thanks in advance vikas ...
Summary: M2 - I let down my guard and you, quite rightly, delivered the sucker punch. As you will see I have edited my first post in this thread. Your thoughts on editing binary files using batch scripting p...