Home › Forums › HTBasic Forum › How do I find the location of HTBasic installation from within a program?
- This topic has 4 replies, 2 voices, and was last updated 3 weeks ago by
Peter M.
-
AuthorPosts
-
November 10, 2025 at 6:42 am #9587
We have a data acquisition system running an HTB program under version 10.13
HT Basic seems to install to a version-specific folder in C:\Progrem Files (x86), in this case \HTBWin 10.1
The program is .prg format and HTB 10.13 will launch by a double click of the program. (The previous version 10.03 wouldn’t do this)
MSI is then the location of the program.
All well and good.My question is – how can I find the location of the HTB installation from within the program so that I can load drivers etc from that location? I don’t want to have to hard-code the location as that would mean re-programming when we next upgrade HTB and it installs to a different folder.
I suspect this is easy but that I am just missing a trick. Advice appeciated!
November 11, 2025 at 8:39 pm #9588Hi Peter,
You can use the COMMAND$ keyword to return the command line used to start the program. If you double click on a .prg file to launch HTBasic, it will return the path and name of the HTBwin.exe run followed by the path to the double clicked program file. This should give you what you need.
As a side note though, any driver that is found at the same location as the HTBwin.exe file, will be found when trying to load it, no matter what the MSI is set to.
Hope this helps,
Pat
November 14, 2025 at 6:01 am #9591Thank you, Pat.
That solves the problem! The COMMAND$ keyword is new to me – and I see it is new-ish to HTBasic.
(I came to HT Basic from HP Basic running on the Basic Language Processor card – a co-processor which plugged into ISA slot on the earliest IBM PCs!)
Interestingly, double-clicking the .prg file works fine to launch my program on HTB 10.13 but not on HTB 10.03. I think this is a known issue but I am not sure which versions will launch a progran from a double click on the .prg file. I haven’t yet found anything in the HTB version history which documents which versions work and which do not when you double click the .prg.
Thank you again,
Peter
November 18, 2025 at 8:46 pm #9592Hi Peter,
That is great to hear this will work for you.
Concerning which versions will allow double clicking on .prg file to launch, I don’t recall exactly what version it was fixed in, but certainly one of the 10.xx versions. I highly recommend updating to HTBasic 2021 as double clicking on the .prg file will certainly work and it contains many improvements from the HTBasic 10 versions.
Thanks,
Pat
November 21, 2025 at 4:08 am #9593Thank you, Pat.
I’ll ask if we an find funding to upgrade. It makes sense to me, but money is a bit tight and we have three copies to maintain!
Thank you for being so helpful with my queries. Much appreciates.Peter
-
AuthorPosts
- You must be logged in to reply to this topic.