Sign in to follow this  
Followers 0
E1M1

Workingdir parameter dont work with autoit script

14 posts in this topic

#1 ·  Posted (edited)

This don't work, When run that exe file I still see "C:\Program Files\ra" as result of msgbox(1,1,@ScriptDir)

ShellExecute(@ProgramFilesDir&"\ra\New AutoIt v3 Script (2).exe","",@WindowsDir)

I also tried

Run(@ProgramFilesDir&"\ra\New AutoIt v3 Script (2).exe",@WindowsDir)

I should see C:\windows instead of "C:\Program Files\ra shouldn't I?

Edited by E1M1

edited

Share this post


Link to post
Share on other sites



The script directory is the directory the script is in.

Share this post


Link to post
Share on other sites

That depends on what the script New AutoIt v3 Script (2).exe is.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

yes I know

I Use @windowsdir as workingdir in my 1-st script that executes 2--nd script. second script is compiled to exe, and its source is as follows

msgbox(1,1,@ScriptDir)

So msgbox(1,1,@ScriptDir) is executed by Run(@ProgramFilesDir&"\ra\New AutoIt v3 Script (2).exe",@WindowsDir)

..

If u cant understand my situation, I can post here installer that makes same situation as I have...

Edited by E1M1

edited

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I want to add that instead of using a launcher to set your working dir for the main script, you can just use this function in your main script :

FileChangeDir(@WindowsDir)

Edited by Inverted

Share this post


Link to post
Share on other sites

But then Whats the point of Run ( "filename" [, "workingdir" [, show_flag[, opt_flag ]]] )

workingdir parameter is useless if it doesn't work.


edited

Share this post


Link to post
Share on other sites

Here's a thought. Stop. Think. Your mistake is so glaringly obvious and stupid that I hope you feel embarrassed for missing something this obvious.

Share this post


Link to post
Share on other sites

Scriptdir is the path to the script file. It doesn't depend on the working directory.

Share this post


Link to post
Share on other sites

Scriptdir is the path to the script file. It doesn't depend on the working directory.

I despise people like you who feel the need to give out an answer to a stupidly obvious problem instead of letting somebody figure it out on his own.

Share this post


Link to post
Share on other sites

ok ... then can I set replace scriptdir variable with workingdir variable?


edited

Share this post


Link to post
Share on other sites

ok ... then can I set replace scriptdir variable with workingdir variable?

Why do you ask instead of trying it. Valik's gonna have a mental breakdown !

Share this post


Link to post
Share on other sites

ok ... then can I set replace scriptdir variable with workingdir variable?

You want to use @WorkingDir so use @WorkingDir. Stop being stupid; this is some obvious stuff and if you can't get this working then you need to just give up on the language.

Share this post


Link to post
Share on other sites

Why do you ask instead of trying it. Valik's gonna have a mental breakdown !

This is exactly why I dislike that you answered the question. He needs to stop asking stupid questions and learn to try stuff and debug his own code.

Share this post


Link to post
Share on other sites

oops I was really stupid, sorry for these stupid posts.


edited

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