Need Help With My Batch App...!!!

Status
Not open for further replies.

Deviouz

Posts: 70   +0
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
 
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..???
 
Status
Not open for further replies.
Back