Sreenivasulu

How to pass root path of the file to be uploaded in Autoit Script

5 posts in this topic

ControlFocus("Open","","Edit1")
ControlSetText("Open","","Edit1","C:\Users\srym\Desktop\FileUpload.txt")
ControlClick("Open","","Button1")

 

This is the AutoIT script written for File upload.

The text highlighted in Red, it is the path of the file that needs to be uploaded.But if want to execute my script in some other machine i need to change this path every time.

So can anyone help me writing this path in generic way so that i dont have to change this path every time running in different machine.

Share this post


Link to post
Share on other sites



If the file always in users desktopdir use

ControlSetText("Open","","Edit1",@DesktopDir&"\FileUpload.txt")

 

Share this post


Link to post
Share on other sites

No Bert it would be in my project framework..

 

Share this post


Link to post
Share on other sites

If i can fetch the project root path then i can add that path. But how to fetch the project root path in AutoIT.

Share this post


Link to post
Share on other sites

?

@ScriptDir & "\FileUpload.txt"

 


Regards,
 

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