| View previous topic :: View next topic |
| Author |
Message |
deviouz
Joined: 28 Mar 2007 Posts: 2
|
Posted: Wed Mar 28, 2007 4:43 pm Post subject: NEED HELP WITH MY BATCH APP...!!! |
|
|
I need some help with this quick batch app im making that uses HSTART.EXE & ROBOCOPY.EXE
Basicaly it checks the Recycle Bin and all removable storage drives for files & then copies all of them to C:\0\1
But i need to figure out how to prevent Robocopy.exe from running the same command thread twice at the same time
when the bacth reapeats over on itself again, if its already in the process of copying files over..
How can i do this..??
{> BATCH CODE APP <}
:UP
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\Robocopy.exe C:\RECYCLER C:\0\1\REC /XX /mir /r:0"
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\Robocopy.exe E: C:\0\1 /XX /mir /r:0"
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\Robocopy.exe F: C:\0\1 /XX /mir /r:0"
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\Robocopy.exe G: C:\0\1 /XX /mir /r:0"
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\Robocopy.exe H: C:\0\1 /XX /mir /r:0"
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\Robocopy.exe I: C:\0\1 /XX /mir /r:0"
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\Robocopy.exe J: C:\0\1 /XX /mir /r:0"
PING 127.0.0.1 -n 5
cls
GOTO UP |
|
| Back to top |
|
 |
|
|
support Site Admin
Joined: 13 Feb 2004 Posts: 299
|
Posted: Thu Mar 29, 2007 5:20 am Post subject: |
|
|
As I understand you have "included" hstart and robocopy files into executable, right?
You can check if these files exists in %MYFILES% folder. If files exists then another copy already started. |
|
| Back to top |
|
 |
deviouz
Joined: 28 Mar 2007 Posts: 2
|
Posted: Thu Mar 29, 2007 7:46 am Post subject: |
|
|
I think i fixed it to work right..
THIS SEEMS TO WORK
{>NEW BATCH CODE <}
:UP
tasklist | find /i "R-copy-1.exe" && goto SKIP-1
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\R-copy-1.exe C:\RECYCLER C:\0\1\REC /XX /mir /r:0"
:SKIP-1
tasklist | find /i "R-copy-2.exe" && goto SKIP-2
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\R-copy-2.exe E: C:\0\1 /XX /mir /r:0"
:SKIP-2
tasklist | find /i "R-copy-3.exe" && goto SKIP-3
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\R-copy-3.exe F: C:\0\1 /XX /mir /r:0"
:SKIP-3
tasklist | find /i "R-copy-4.exe" && goto SKIP-4
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\R-copy-4.exe G: C:\0\1 /XX /mir /r:0"
:SKIP-4
tasklist | find /i "R-copy-5.exe" && goto SKIP-5
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\R-copy-5.exe H: C:\0\1 /XX /mir /r:0"
:SKIP-5
tasklist | find /i "R-copy-6.exe" && goto SKIP-6
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\R-copy-6.exe I: C:\0\1 /XX /mir /r:0"
:SKIP-6
tasklist | find /i "R-copy-7.exe" && goto SKIP-7
start %MYFILES%\hstart.exe /nowindow "%MYFILES%\R-copy-7.exe J: C:\0\1 /XX /mir /r:0"
:SKIP-7
PING 1 -n 5
cls
GOTO UP
I just need now to find a way for Robocopy.exe to not overwrite files in the destination DIR , if in the source DIR it copies files with same names that are in the Destination DIR, but rather renames the new copied files..
You know the switch for that at all..??? |
|
| Back to top |
|
 |
|