Sign in to follow this  
Followers 0
stevendm

Drop Like a Batch File

12 posts in this topic

I want to have a au3 script that acts like a powerful batch file. I want to have this file sitting on my desktop and it would allow me to drop a file (or multiple files) onto it and have the script run, reading the command line parameters and acting on them.

I have tried this and the script does not seem to start when I drop a file onto it. Is there a way to do this?

Also, when I installed AutoIT I set it so that double clicking edits the file. How can I change it so that double clicking rus the file?

Thanks

Steven

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I want to have a au3 script that acts like a powerful batch file. I want to have this file sitting on my desktop and it would allow me to drop a file (or multiple files) onto it and have the script run, reading the command line parameters and acting on them.

I have tried this and the script does not seem to start when I drop a file onto it. Is there a way to do this?

Also, when I installed AutoIT I set it so that double clicking edits the file. How can I change it so that double clicking rus the file?

Thanks

Steven

Can you post your script or an example script so we can see what you've tried/why it doesn't look like the script is running?

You need to read the filenames passed to it using the $CmdLine array, have you read the help file about this variable?

Edit: Note you can't drag files onto an uncompiled script and expect it to run...Windows will only trigger executable files when another file is dragged onto it. Have you compiled your script?

Edit 2: By the way, welcome to AutoIt :-)

Edited by james3mg

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites

Also, when I installed AutoIT I set it so that double clicking edits the file. How can I change it so that double clicking rus the file?

Associate your .au3 files with AutoIt3.exe.

Share this post


Link to post
Share on other sites

...Also, when I installed AutoIT I set it so that double clicking edits the file. How can I change it so that double clicking rus the file?...

I'm sure that there is a better answer than the one that I'm going to suggest, but just re-install AutoIt and make the selection you want. :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Thanks to all for the very quick responses. I cheated. I made a batch file that called my au3 script, passing the parameters. Dirty, but it works.

I am going to compile it and see if that works.

Share this post


Link to post
Share on other sites

Compiling it worked great. Thanks

Share this post


Link to post
Share on other sites

...maybe you can

I stand corrected :)

Compiling it worked great. Thanks

Glad to be of service! :D

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites

I stand corrected :) ...

I was in agreement with you right up until I found that post. I did not know that you could do that either. I just found it while searching thru the forum for info to contribute to this thread.

Like CyberSlug said, it might come in handy when debugging a script.

-MSP-


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Heres a script i made that demonstrates how you can drag files onto the compiled executable and it sends it to the "Abyss Web Server" directory. It's how i got used to CmdLine params and file movement

http://www.autoitscript.com/forum/index.ph...c=43188&hl=

Edited by Senton-Bomb

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