Jump to content

Recommended Posts

Posted

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.

  • Moderators
Posted

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.

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.

  • Moderators
Posted

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.

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.

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...