Jump to content

Drag&Drop directly to .exe


Dryden
 Share

Recommended Posts

Hi!

I'm trying to make a script that when compiled it does certain operations to each file that is dragged to it.

Can you guys help me?

To keep it simple, lets suppose that i wanted a script that runs the filer dragged into it with "Run()" for example.

thx in advance.

"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." - Terry Pratchett.

Link to comment
Share on other sites

I don't think Dryden meant that (but I could be wrong :P ). It would be too obvious.

@Dryden;

I posted an example for monocereses "DEE - Dll Exports Viewer". Check here.

Application is initialized by dropping files onto it (it process that file).

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

What I want is to have my script compiled in .exe ant without executing it drag & drop a file into it and the script opens it.

"Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." - Terry Pratchett.

Link to comment
Share on other sites

What I want is to have my script compiled in .exe ant without executing it drag & drop a file into it and the script opens it.

Trancexx gave an example but here is a description of what to do.

First you need to understand that when you drop a file onto an executable that Windows simply runs the executable with the file name as a parameter. So you just need to be able to deal with a parameter in your script.

Read the section in the help about "running scripts" and understand what it says about parameters, $CmdLine[0] etc.

In your script you must check somewhere near the start if there are any parameters passed. Is $CmdLine[0] > 0?

If $cmdLine[0] is greater than 0 then the first paranmeter is $CmdLine[1] which in your case will be the name of the file dropped onto the exe.

You can test how a script deals with parameters without having to compile it if you use SciTE. The parameters are set in the view menu.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
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
 Share

  • Recently Browsing   0 members

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