Sign in to follow this  
Followers 0
lordsepid

how can i locate a file in temp directory ?

6 posts in this topic

hi

i'm new with this software

i wanted to run an ".exe" file from temp directory but i can't locate it.

i tried to use @TempDir or other macros but it didn't work.

is there anything helpful in autoit that works like "%temp%" in cmdline ?

Share this post


Link to post
Share on other sites



hi

i'm new with this software

i wanted to run an ".exe" file from temp directory but i can't locate it.

i tried to use @TempDir or other macros but it didn't work.

is there anything helpful in autoit that works like "%temp%" in cmdline ?

Look if @TempDir is exactly dir if you want.

MsgBox(0,"TempDir",@TempDir)
ShellExecute(@TempDir & "\Program.exe")

When the words fail... music speaks

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

It is possible that @TempDir does work, but you didn't put the "\" between the @TempDir and the filename.exe.

Try this to see which location the @TempDir holds:

MsgBox(0, "@TempDir location", "@TempDir holds this location: " & @CRLF & @TempDir)

Edit: Damnit!!!! Another one who beat me ;)

It's a conspiracy I tell you! :D

Edited by Triblade

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

thanks but I've tried "\" also i've tried @HomePath , @HomeDrive and some other macros but none of them worked for me.

maybe i'm using it with the wrong code. this is what i use:

for example : Run("7z.exe", "@HomeDrive")

or : Run("@HomeDrive\7z.exe")

If i use "C:\" instead of "@HomeDrive" it works but i don't want to use the drive letter because it might change.

so what should i do ?

pls help me

thx

Andreik, i used your code and it worked but i don't understand, this is not the way that the "help" uses "ShellExecute"

would you explain it to me pls ?

Edited by lordsepid

Share this post


Link to post
Share on other sites

Andreik, i used your code and it worked but i don't understand, this is not the way that the "help" uses "ShellExecute"

would you explain it to me pls ?

Help explains it perfectly to me.

If you don't realize yet, the parameters with [ and ] around them are optional.

Share this post


Link to post
Share on other sites

alter : Run("7z.exe", "@HomeDrive")

to : Run("7z.exe", @HomeDrive)

He is most likely right.

What that means is @HomeDrive is a macro.

Macro's shoulden't be quoted (read: wrapped in "")

Text within quotes means litteral text.

So:

input = outcome

"@HomeDrive" = @HomeDrive

@HomeDrive = C:


My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

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