Solved

Opening local htm with variable

Posted on 2014-01-30
12
253 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
Comment Utility
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 18

Expert Comment

by:zc2
Comment Utility
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
Comment Utility
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
 
LVL 30

Author Comment

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

Expert Comment

by:Gary
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 30

Author Comment

by:Mike Lazarus
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
How do you think that will solve your question?
0
 
LVL 30

Author Comment

by:Mike Lazarus
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now