NEED HELP WITH MY BATCH APP...!!!

Convert your BATch files into EXEcutable format in one click.
Post Reply
deviouz
Posts: 2
Joined: Wed Mar 28, 2007 4:42 pm

NEED HELP WITH MY BATCH APP...!!!

Post by deviouz » Wed Mar 28, 2007 4:43 pm

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

support
Site Admin
Posts: 399
Joined: Fri Feb 13, 2004 1:05 pm

Post by support » Thu Mar 29, 2007 5:20 am

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.

deviouz
Posts: 2
Joined: Wed Mar 28, 2007 4:42 pm

Post by deviouz » Thu Mar 29, 2007 7:46 am

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..???

Post Reply