Naumishe

Can't transfer parameters into script

12 posts in this topic

Hi all!

After reinstall OS - Windows 10 Home get some new problem for me with AutoIT.

There is 1 little script test.au3- 

Quote

#include <MsgBoxConstants.au3>

MsgBox($MB_SYSTEMMODAL, "Title", $cmdline[0], 10)

If I run it from CMD or powershell by command -

test.au3 12312312312

I get "0" instead of "1". So I think that something in my new OS prevents to transfer parameters into script.

Someone knows what happened?

Share this post


Link to post
Share on other sites



When I use

"C:\Program Files (x86)\AutoIt3\autoit3.exe" C:\temp\test_CMD.au3 123

it works just fine.
You are sure that the file type association of au3 is correct?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Off course, I receive window from Auto IT with title - "Title" and variable $cmdline[0] that just 0 instead of 1.

P.S. On other computer it all work fine.

Share this post


Link to post
Share on other sites

Sorry, if I type in cmd 

"c:\Program Files (x86)\AutoIt3\AutoIt3.exe" test.au3 123         it is show me 1

test.au3 123 it is show me 0

WTF? 

Share this post


Link to post
Share on other sites

Is there another test.au3 in another directory that gets executed by Windows?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

No. It is my script  - show Msgbox with title "Title" and in windows - text $cmdline[0] that show how many parameters was send to script.

If I just launch script something prevents transferring parameters and it is show 0

 

Share this post


Link to post
Share on other sites

What do you get if you run

#include <MsgBoxConstants.au3>
MsgBox($MB_SYSTEMMODAL, "Title", ">>" & $CmdLineRaw & "<<", 10)

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

---------------------------
Title
---------------------------
>>"C:\Users\Naum\Desktop\test2\test3.au3"<<
---------------------------
ОК   
---------------------------
 

Share this post


Link to post
Share on other sites

When you double click your script in Windows Explorer does it get executed or does this start SciTE for editing the script source?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#10 ·  Posted

Double click ot script execute it and I see Msgbox Window (with 0 or last message).

Share this post


Link to post
Share on other sites

#11 ·  Posted

@Naumishe $cmdline[0] is just a counter .

Re-read AutoIt help file about "Running Scripts - Command Line Parameters"

Share this post


Link to post
Share on other sites

#12 ·  Posted

True. But even the counter should return a value > 0 when parameters are passed to the script.
It seems that the way the OP calls the script parameters aren't accepted.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

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