Sign in to follow this  
Followers 0
welby345

Drag and Drop command line parameter

3 posts in this topic

#1 ·  Posted (edited)

I searched the forums, but did not find what I was looking for...maybe I didn't search the right key words...so here goes.

I have a working script that parses out extraneous characters from a simple text file. I can run the command as follows:

cleanup samplefile.tx

From a command line, and the file samplefile.txt will be opened and cleaned up. What I want is the ability to drag the txt file from explorer onto the cleanup.exe file (compiled from autoit).

How do I go about this?

Edited by welby345

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I think I found the problem. When I drag and drop, I have a long string describing the file. When I go command line, I have a simple file name. I think I have to parse out the inout string and get everything between the last \ and the end of the cmdline[1].

Bujt shouldn't file open work with the full path? Shouldn't both ways work?

Edited by welby345

Share this post


Link to post
Share on other sites

Full path, yes. Relative path, yes. These answers are based on competant code created by you. Use double quotes around paths with spaces as needed within your code. The last "I think..." seems unnecessary.

:whistle:

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