Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Opening local htm with variable

Posted on 2014-01-30
12
Medium Priority
?
281 Views
Last Modified: 2014-07-07
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
Comment
Question by:Mike Lazarus
  • 5
  • 4
12 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39821598
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
 
LVL 19

Expert Comment

by:zc2
ID: 39821613
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
 
LVL 30

Author Comment

by:Mike Lazarus
ID: 39821638
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 30

Author Comment

by:Mike Lazarus
ID: 39821645
Web server won't work ... the file is in a folder off %ProgramData% - part of another app.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39821648
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
 
LVL 30

Author Comment

by:Mike Lazarus
ID: 39821654
It's sort of what I'd guessed.

There's no other option to look at that might be simple?
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39821667
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
 
LVL 30

Author Comment

by:Mike Lazarus
ID: 39821876
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
 
LVL 58

Expert Comment

by:Gary
ID: 39821892
How do you think that will solve your question?
0
 
LVL 30

Author Comment

by:Mike Lazarus
ID: 39854195
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question