• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • Last Modified:

Opening local htm with variable

I want an app to open a local htm help file ... no local web server.

This URL works in Firefox and IE (if 127.0.0.1 added to trusted sites):
\\127.0.0.1\c$\ProgramData\Folder\Default.htm

It looks fine in IE. In Firefox, ir becomes:
file://///127.0.0.1/c$/ProgramData/Folder/Default.htm
But still works

But I'd like to use a variable like %ProgramData% or %AllUsersProfile% so that it works in XP  as well.

However, I don't seem to be able to get the right format ... is it possible?
0
Mike Lazarus
Asked:
Mike Lazarus
  • 5
  • 4
1 Solution
 
GaryCommented:
That won't work in Firefox, IE is written to act like Explorer so it will work but FF is not.
For IE
%ProgramData%\file.htm
will work
0
 
zc2Commented:
I would recommend to implement your own very simple web server in your application and open the help pages using it as the source, like
http://localhost:54321/pagename.htm
54321 - the port your simple web server listens. Could be any number greater than 1000
0
 
Mike LazarusAct! Evangelist - CRM ConsultantAuthor Commented:
Actually, that won't work for me in IE either ...
I need to have the domain as Compatibility and Trusted Sites ... can't do that with the way you have.

That's why I have the \\127.0.0.1\ above :-)
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Mike LazarusAct! Evangelist - CRM ConsultantAuthor Commented:
Web server won't work ... the file is in a folder off %ProgramData% - part of another app.
0
 
GaryCommented:
You cannot mix the two - one is a file system browsing (%ProgramData%) and one is webserver system (127.0.0.1 - which only has access to the server root folder and sub folders)
0
 
Mike LazarusAct! Evangelist - CRM ConsultantAuthor Commented:
It's sort of what I'd guessed.

There's no other option to look at that might be simple?
0
 
GaryCommented:
No, to have access to the local file system you have to use the folder structure of the computer or if in IE using the system environment variables.
0
 
Mike LazarusAct! Evangelist - CRM ConsultantAuthor Commented:
Just found this ... I might have a play next week:
https://developer.mozilla.org/en-US/docs/MCD,_Mission_Control_Desktop_AKA_AutoConfig

Also not sure what info PR_GetEnv might pass
0
 
GaryCommented:
How do you think that will solve your question?
0
 
Mike LazarusAct! Evangelist - CRM ConsultantAuthor Commented:
I haven't had the time yet ... but hoping I can read and use the env vars as per:
https://developer.mozilla.org/en-US/docs/MCD,_Mission_Control_Desktop_AKA_AutoConfig#Windows_Particularities
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now