# user's autoit directory

## Recommended Posts

i need to figure out the user's autoit directory, such as "program files\autoit3\"

thanks!

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

##### Share on other sites

Just use the Applications path in the registry

$value = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutoIt3.exe', '')$value = StringLeft($value, StringInStr($value, '\', 0, -1)-1)
MsgBox(0, '', $value) This will work if AutoIt was installed and not from a zip file. ##### Link to post ##### Share on other sites i dont want the path to autoit3.exe, i want the path to the directory in program file that autoit is installed in, such as "program files\autoit3\" The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN ##### Link to post ##### Share on other sites Did you test that. AutoIt3.exe resides in the directory. That is why I used string*() functions to remove the '\AutoIt3.exe' from the full path returned with RegRead(). ##### Link to post ##### Share on other sites oh heh srry ok thanks then The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN ##### Link to post ##### Share on other sites but i want the version removed...for example, it comes up with "\program files\autoit3\beta" but i want the "beta" removed The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN ##### Link to post ##### Share on other sites Oh, Ok. I do not use the beta installer. I use the beta zip. So was unaware of this scenerio. Just adding StringReplace should cover for this difference of version. $value = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutoIt3.exe', '')
$value = StringLeft($value, StringInStr($value, '\', 0, -1)-1)$value = StringReplace($value, '\beta', '') MsgBox(0, '',$value)
##### Share on other sites

but the user could be using some other version of autoit, so that would be specific to me and other beta users

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

##### Share on other sites

The above gives you the directory to AutoIt3.exe. If you are enquiring about someone like me, who uses both release and beta? Then use If FileExists for the presence of the Beta directory within the AutoIt directory. For other concepts, then specify more.

##### Share on other sites

nvm i figured out a way...

$value = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutoIt3.exe', '')$value = StringLeft($value, StringInStr($value, '\', 0, -1)-1)
$beta = StringInStr ($value, "\beta" )
If $beta <> 0 Then$value = StringReplace($value, '\beta', '') EndIf MsgBox ( 0, "",$value )

thanks!

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

##### Share on other sites

If you want to know if someone has the beta in a subdirectory of the AutoIt directory, then you could use this.

$value = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutoIt3.exe', '')$value = StringLeft($value, StringInStr($value, '\', 0, -1)-1)
$value = StringReplace($value, '\beta', '')
If Not @extended Then
If FileExists($value & '\beta') Then$value = $value & '\beta' EndIf MsgBox(0, '',$value)
##### Share on other sites

Or you could (unimaginatively enough), read the values "InstallDir" and "BetaInstallDir" located at "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt".

##### Share on other sites

I do not have "BetaInstallDir", as to usage of beta zip. Nice try.

##### Share on other sites

I do not have "BetaInstallDir", as to usage of beta zip. Nice try.

<{POST_SNAPBACK}>

Guys, never heard of @AutoItExe ??

@AutoItExe - The full path and filename of the AutoIt executable currently running. For compiled scripts it is the path of the compiled script.

Doesn't matter if beta version, installed or from ZIP file. Use String* functions to get the path only...

EDIT: Or even better. Use _PathSplit()

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

##### Share on other sites

I do not have "BetaInstallDir", as to usage of beta zip. Nice try.

<{POST_SNAPBACK}>

Then there are no guarantees that even the presence of a "beta" directory will actually contain a valid beta version of AutoIt or that should a "valid" beta be found it may not be the newest (Meaning a newer version could be elsewhere). I also don't understand how you expect the AutoIt AppPath entry to be present unless the installer sets it, so we're back to being able to detect only valid (installer) installations, anyway, ergo, checking the two values I mention above is an easier solution than reading the AppPath key and doing splitting and all that stuff.

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...