hello guys,
its me again and need help again!
With the developing technology, plot production times have really decreased. this led to the need to update existing scripts (at least for me)
i am using this script for copy plot files but problem is hard drive going to full. so i need a loop example;
send 70 plot files to a drive from the source , after that stop all and start copy 70 plot files to b drive. from the source.
@echo off
:RESTART
TITLE Transfer Plots from temporary to final location
echo.
robocopy E:\gidenler G:\ “plot*.plot” /MOV /MT:32
echo.
timeout 10 /nobreak
GOTO RESTART
you might want to consider copying to two drives in parallel (im guessing you are copying from an nmve to hdd):
Its just written down, i didnt test both versions you might encounter an issue which you have to correct.
copy_plots.ps1:
$src = "E:\gidenler"
$destA = "A:\"
$destB = "B:\"
$filePattern = "plot*.plot"
$fileLimit = 70
while ($true) {
# Start a new job to copy files to drive A
Start-Job -ScriptBlock {
robocopy $using:src $using:destA $using:filePattern /MOV /MT:32 /LIMIT:$using:fileLimit
}
# Start a new job to copy files to drive B
Start-Job -ScriptBlock {
robocopy $using:src $using:destB $using:filePattern /MOV /MT:32 /LIMIT:$using:fileLimit
}
# Wait for both jobs to complete
Wait-Job -Any
# Wait for 10 seconds before repeating the loop
Start-Sleep -Seconds 10
# Prompt user to press Enter to continue
Write-Host "Press 'Enter' to repeat or 'q' to exit"
$key = [Console]::ReadKey()
if ($key.Key -eq "q") {
break
}
}
My best guess is that you want to change the harddrives after the 70 plots.
The script pauses after copying to both drives. pressing enter will start the next loop and copy 70 files to both drives again.
If you want to loop indefinitely without pause, remove the last part.
thank you for helping me.
i generate bat file but when i double click on it, its closed itself really fastly. i cant see anything and not move anything