Jump to content

running au3 files from command line problem


Klaatu
 Share

Recommended Posts

OS: Windows 7 64 bit

I first installed AutoIt3 saying for it to use 64 bit versions where possible. When I found out that probably wasn't a good idea (for what I normally do) I uninstalled and reinstalled saying no this time so it would use 32 bit versions as default.

I don't know if the above has anything to do with the problem I'm having, but regardless here's my problem: when I type the name of an au3 file on the command line and follow it with parameters, the au3 file runs alright except it doesn't recognize that I've put parameters on the command line and basically ignores whatever I've put.

Tried searching the forum but found nothing useful. TIA

My Projects:DebugIt - Debug your AutoIt scripts with DebugIt!
Link to comment
Share on other sites

Based on your description, I can only say that it WORKS. Unless you can post a reproducer that actually fails I don't see how anyone can help you here.

As an example, I ran this in cmd:

"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "C:\Users\Ärkeskäggot\AutoIt Sync\Mina Småprogram\command line parameters test.exe" "C:\Users\Ärkeskäggot\Hej då"

And this is the script:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compression=0
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
MsgBox(0, "", $CmdLineRaw)
If IsArray($CmdLine) Then
    For $X = 0 To UBound($CmdLine) -1
        MsgBox(0, "", $CmdLine[$X])
    Next
EndIf

And I got 3 MsgBox(), exactly as expected.

Link to comment
Share on other sites

  • Developers

I think the OP is referring to running an script.au3 file from the commandprompt and probably has the default set to Run.

Check the registry setting for files with an ".au3" extension:

HKCR\AutoIt3Script\Shell\Run\Command

Default: "C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe" "%1" %*

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

Thanks Jos. Yes, that's what I'm speaking of.

However, the key you pointed me to was exactly as you described. I don't know if this is unique to Win7 or not, but I did find a key

HKCR\Applications\AutoIt3.exe\shell\open\command

that didn't have the "%*" following the "%1". I added it and it seems to have solved the problem.

Thanks for pointing me in a direction that fixed it.

My Projects:DebugIt - Debug your AutoIt scripts with DebugIt!
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...