B4J Question Get B4A Path

Roycefer

Well-Known Member
Licensed User
Longtime User
B4X:
cd C:\
dir /s /b B4A.exe

Beware, it's slow as HELL because it searches the whole C:\ drive.
 
Upvote 0

Roycefer

Well-Known Member
Licensed User
Longtime User
You can narrow down the search if you suspect it will be in the Program Files (x86) or the Program Files folders. Those searches will be a lot quicker. You can also test all the drive letters to see if they contain a Program Files (x86) or Program Files folder. There's a bit you can do to streamline this.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
the fastest would be this

B4X:
reg query "HKCR\B4A Source Code\DefaultIcon"

and parse the result

B4X:
HKEY_CLASSES_ROOT\B4A Source Code\DefaultIcon
    (standaard)    REG_SZ    C:\Program Files\Anywhere Software\Basic4android\B4A.exe,0
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
I don't know if B4J supports regRead if not you can call the above which doesn't require an additional file or use an addition batch/vbscript file.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…