Move a file

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Move a file

Post by PepsiHog » Mon Sep 25, 2017 10:38 pm

Hello,
Is there a vb script that will copy a file, wait til it is copied, and then copy another? Or is there a way to do that with movefile or any other command? I tried using that command but the script continues before it finishes the copy. I need to move many many files, large files. So if it doesn't wait for the process to finish it will end up locking up.

Thanks for helping,
PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Move a file

Post by Marcus Tettmar » Tue Sep 26, 2017 9:08 am

MoveFile should wait for completion before continuing. Never known it not to. So I'm not sure why you are seeing different. But if you don't want to use MoveFile you could run>cmd.exe /c move .....
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

olllllliii
Pro Scripter
Posts: 60
Joined: Tue Dec 22, 2009 9:51 am
Location: Mannheim ( Germany )
Contact:

Re: Move a file

Post by olllllliii » Wed Oct 04, 2017 2:33 pm

Hallo , i use robocopy for the copywork ,

Let>path=C:\Windows\System32\Robocopy.exe
Let>source=c:\test
Let>target=d:\mytarget\
Let>options=/COPY:DAT /E /MT /W:2

// Robocopy Action
Let>Action=%path% %source% %target% %options%

Let>RP_WINDOWMODE=1
RunProgram>%Action%
Label>hier
WaitWindowClosed>C:\Windows\System32\Robocopy.exe
ProcessExists>Robocopy.exe,pExists
IF>pExists=True
Goto>hier
ELSE
ENDIF
exit
Oliver Hilger Mannheim
alias Olllllliii

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts