Sign in to follow this  
Followers 0
mailask

Choose multiple files by autoit

4 posts in this topic

Hello,

I have the next code:

1 ;MsgBox(0,"Parameters",$CmdLine[1]) ;Sending parameters through command line

2 FileCopy("C:\W3C.png", "C:\"&$CmdLine[1]&".png") ;Make a duplicate copy of the file, as same file name is not accepted

3 sleep(3000);delay for 3 seconds for the file to create

4 WinWaitActive("#32770", "Choose File to Upload",10)

5 WinFlash("Choose File to Upload","", 4, 500) ; Just to Flash the window

6 ControlSetText("Choose File to Upload", "", "[CLASS:Edit; INSTANCE:1]", "C:\"&$CmdLine[1]&".png") 7

ControlClick("Choose File to Upload", "","[CLASS:Button; INSTANCE:2]");

Runtime.getRuntime().exec("C:\\NEW.EXE " + FileName); //call Autoit script with one parameter FileName

which works perfect when I choose in File name just one file. It make problems when I insert multiple files. meaning, fileName = "file1" "file2" "file3".

I write just file 1, and doesn't continue.

Hoe can I solve this issue?

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!

What is "Runtime.getRuntime().exec"?

Shouldn't "FileName" be a variable?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.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
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Runtime.getRuntime().exec is the command I run from java.

Yes, FileName is a variable.

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