Jump to content

How to Retrieve AutoIT Executable Filename?


Recommended Posts

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

Link to comment
Share on other sites

  • Developers

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?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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:

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...