Solved

Adding a UNC link to a printer in a HTML page.

Posted on 2008-06-17
5
1,065 Views
Last Modified: 2010-04-21
I'm currently writing a page for users to give them HTML links to printers which we have created on our print cluster.

the link i'm trying to create is  "\\SERVERNAME\PRINTERNAME", but whenever the i'm trying to add the link, it appears as "http:///SERVERNAME/PRINTERNAME".

Is there any way of presenting the information into HTML so that it loses the HTTP:// and doesn't reverse the "\"'s ???
 e.g. :

\\SERVERNAME\PRINTERNAME

Appears in the web page.

Many Thanks in advance

<TITLE>Printers</TITLE>

</HEAD>

<BODY>

<p><A HREF="/\\wvc-prtv-01\wvc-01-01-hplj4250">\\wvc-prtv-01\wvc-01-01-hplj4250</A></p></BODY>

</HTML>

Open in new window

0
Comment
Question by:mick_rouse
  • 2
  • 2
5 Comments
 
LVL 18

Expert Comment

by:Matthew Kelly
ID: 21810456
If you put "file:///" in the front of the"\\server-name" it will open from internet explorer (seems pretty slow though).

As you posted firefox as well that may not help you.

Do you happen to have any control over the web server, and if so, is it Apache?

If it is Apache you can add a server alias as I have done before for a project. See the snippet code and add something similar to httpd.conf. This will make it so going to "http://<server-name>/data" go to "//company-server/Data/"

You need to have the mod_alias module loaded, so

"LoadModule alias_module modules/mod_alias.so"

Needs to be in the httpd.conf file as well.

Untested with printers, but works with shared drives.
Alias /data/ "//company-server/Data/"

<Directory "//company-server/Data/">

    Options Indexes MultiViews

    AllowOverride None

    Order allow,deny

    Allow from all

</Directory>

Open in new window

0
 

Author Comment

by:mick_rouse
ID: 21812296
Unfortunately it's actually hosted on a customers server, so the addition of any other modules is unfortunately out of the question :(
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 125 total points
ID: 21836195
If the web page is an Internet page then you won't be able to do this.  Almost all current browsers and versions will prevent this type of access to the client machine.  At the very least you will get a security warning but most times you won't even be asked.

Of course if the page is just an intranet or local page then you might be able to do this.  An HTA page is a good option if you want something IE specific. :)

bol
0
 

Author Closing Comment

by:mick_rouse
ID: 31467960
Thanks for that.

I've decided to go down that route.
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 21909110
Your welcome!  I'm glad I could help.

I noticed the B grade.  Did you still have a question or need help with this?  If so let me know and I will be happy to provide what I can.  There really wasn't much to this answer but I thought my comment was pretty complete with why and an alternative.  If a mistake was made when you closed this or you have a question about grading on EE then let me know.  There is some good info on grading at http://www.experts-exchange.com/help.jsp#hi97 if you are interested or haven't seen it.  It is nice to always have a chance to earn the A or at least know why it wasn't. :)

Thanks for the fun question.

bol
0

Featured Post

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

Join & Write a Comment

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.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

708 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

17 Experts available now in Live!

Get 1:1 Help Now