Sign in to follow this  
Followers 0
chipmonger

How to Retrieve AutoIT Executable Filename?

9 posts in this topic

Need to retrieve the name of a compiled AutoIT script when it's running (I'm using the same code snippet in multiple programs and don't want to have to edit the snippet each time when pasting it into another script). I've tried to look around, but haven't been successful (probably using the wrong search terms). Any assistance would be appreciated.

Thanks,

Chip

Share this post


Link to post
Share on other sites



Did you check the Helpfile?

@ScriptName maybe?

Thank you. That seems to work fine, except in cases where the file name has a space in it. I can work around that replacing spaces with underscores.

Share this post


Link to post
Share on other sites

Thank you. That seems to work fine, except in cases where the file name has a space in it. I can work around that replacing spaces with underscores.

what is the issue when the name contains spaces?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

what is the issue when the name contains spaces?

I figured it out. I'm passing the program name to a second program to update a file. Since the program name had a space when it was passed, the called program treated it as a second command line parameter. I've modified the called program to check for the second command line parameter, and if found, handle it properly.

Thanks again,

Chip

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I figured it out. I'm passing the program name to a second program to update a file. Since the program name had a space when it was passed, the called program treated it as a second command line parameter. I've modified the called program to check for the second command line parameter, and if found, handle it properly.

Thanks again,

Chip

What about when you put your filename in double quotes on the commandline? Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

What about when you put your filename in double quotes on the commandline?

Haven't tried that. I'm just using 'Run("C:\LogFile.exe " & @scriptname)', knowing that the filename is at most two words.

Share this post


Link to post
Share on other sites

It's fine when it works but if you ever need it my guess would be that this should work too:

Run('C:\LogFile.exe "' & @ScriptName & '"')

Jos :mellow:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

It's fine when it works but if you ever need it my guess would be that this should work too:

Run('C:\LogFile.exe "' & @ScriptName & '"')

Jos :mellow:

Will keep that in mind. Thanks again for your help with this newbie. :(

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