Sign in to follow this  
Followers 0
dlp

DirCopy freezes script?

6 posts in this topic

I've made a script to transfer files from the computer it's run on to a network computer. Simple stripped down version:

$origin = "C:\origin" ; folder to be copied
$dest = "\\machinename\destination" ; folder to be copied into
DirCopy( $origin, $dest, 1 ) ; 1 being used even though it really doesn't need to be

When you run this as a script from SciTE, or as a compiled .exe, the GUI this is built on becomes unresponsive, like a frozen windows app, until DirCopy is done. Then the GUI becomes responsive again.

Is this normal behavior? Is there any way of having it remain responsive while still copying? I'm just afraid the users I made this for will panic when they see it acting like that.

Also, is there any way to put a Cancel command on this command? So a button that when pressed, the copy is cancelled?

Thanks.

Share this post


Link to post
Share on other sites



During the copy you don't have control of the GUI, you would need to run the DirCopy() in another process like using /AutoIt3ExecuteLine or /AutoIt3ExecuteScript to keep control of the GUI. The larger the directory, the more time you will not have control of the GUI.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

What if the computer the script is being run on does not have AutoIT installed?

Share this post


Link to post
Share on other sites

Um...bump? Anyone?

Share this post


Link to post
Share on other sites

If you compiled it, it doesn't matter, if your running it as a script, then you need to use one of the methods above I've already mentioned (with a compiled exe) or have autoit installed.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Write a second script for the copy job. Start it from the first script with parameters.

Run('secondscript.exe $origin $dest')

EDIT: In the second script use '$CmdLine[]'.

Edited by Briegel

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0