Adding Network Printer From Intranet

Oct 13, 2011

Looking over other threads on this site I was able to use another members script to build my own for adding a network printer via JavaScript on our Intranet. With that, the script works perfectly fine when testing it on the local machine I built it on, but not on other machines in the office. Currently I'm remoted into the branch office I reside in from the corporate office where I'm currently at so the machines being tested are on different subnets, but the script is simple calling the UNC path for the printer. When tested on any other computer, and the link is clicked on the page, the user is taken back to the folder in windows explorer the HTML file is saved in, rather than executing the add printer portion of the script.

This is my full code as of now, I was trying to get the function correct before formatting the actual website (obviously)
Code:
<html><head>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Printer Mapping</title>
</head>
<script>
function addPrinter25(){
var x=confirm("You are about to add printer GPSACC01. Would you like to make this your default printer?")
if (x==true){
WshNetwork = new ActiveXObject("WScript.Network");
var PrinterPath = "\\gpsprnt02\gpsacc01";
WshNetwork.AddWindowsPrinterConnection(PrinterPath);
WshNetwork.SetDefaultPrinter(PrinterPath);
alert("Printer GPSACC01 has been added successfully and set as default")
}else{
WshNetwork = new ActiveXObject("WScript.Network");
var PrinterPath = "\\gpsprnt02\gpsacc01";
WshNetwork.AddWindowsPrinterConnection(PrinterPath);
alert("Printer GPSACC01 has been added successfully")
}}
</script>
<font color="#0000FF" face="Arial">
<a href="" onclick="addPrinter25(); return false;">GPSACC01</a></font>
</body></html>

View 1 Replies


ADVERTISEMENT

Intranet Links

Jul 20, 2005

I want to place a piece of JavaScript at the top of my page/s that wil
tell all links on that page to open in certain target windows dependin
on the hostname.

Suppose the intranet address is http://intranet
so this means that the hostname is "intranet" right?
If I want all intranet page links to open in the same window but al
other links (ie external internet links) to open in a new windo
(_blank) then would I use something like below? Please correct an
place I've gone wrong:

if(document.links.hostname == "intranet") {
this.target = "_top";
} return true;

But somewhere in there I would also need an "else" statement to tell i
to open all other links in "_blank" target. Can someone please tell m
where that should be added in. I'm fairly new to javascript and am no
exactly sure what order some of this stuff should go in.

View 1 Replies View Related

Web Analytics For Intranet

Sep 7, 2010

My company is in the search process for using web analytics on our company intranet application. Anyone have any recommendations for some 3rd party software to accomplish this?

We use Google analytics for the public site, but according to the documentation, we have to use a fully qualified domain name for the intranet it order for it to work with google.

View 3 Replies View Related

Local Area Network (LAN)

Nov 6, 2007

Both an EtherNet (wire) network and a wireless network are referred to
as a Local Area Network (LAN). A wireless network does not require
hubs, switchers, or routers to include additional users on the
network. Additional wireless users are supported just by being in the
immediate physical span of the network.

A wireless LAN (or Wi-Fi network) may be configured in two different
ways:

Ad Hoc mode: Allows only for communication between different personal
computers and wireless devices, often referred to as peer-to-peer
communication.

Infrastructure mode: Required for communication with the World Wide
Web, a printer, or a wired device of any sort. In either case, this
wireless connection requires a wireless network adaptor, often called
a WLAN card. Code:

View 3 Replies View Related

Distinguish Intranet From Internet Requests

Nov 2, 2006

I've noticed that IE have different security approach when loading a
page from an inner intranet or when loading a page from the web.

Is there a way in Javascript to know when your page is running by an
outsider and when by an insider? How the browser knows?

View 1 Replies View Related

Reading Network Parameters From Javascript

Jul 20, 2005

Is it possible to read the computers IP address and gateway address
using Javascript?

View 2 Replies View Related

Parse XML File From Network Share

Apr 2, 2010

I have a web page that is not and will not be hosted on a web server. So no PHP, ASP solutions will work here. The method of access is File://. We only run IE 7/8 so no solutions that are firefox only. Here is what I want to do: Use javascript to build a table by reading a XML file stored in the same folder. When I try to use something like:

[Code]....

View 7 Replies View Related

Display Username In Company's Intranet Header

Jul 23, 2005

I've been going bonkers trying to find the answer to this question...
I'm hoping somebody out there can help me. Our network environment is
Active Directory and our web server is Windows 2003 IIS 6.

I've got an ASP page that we include into each of our pages to act as
our companywide header. We force users to authenticate into our
Intranet site, and we are able to display the following information
about them on each page:

Welcome (username)
Today is (whatever)

Can Javascript or Dhtml or something else get me this information? We
have thousands and thousands of webpages and I don't want to have to
use the .asp extension on every single one if I don't have to... but I
can't find a way to display the username in the header without it =|
Somebody mentioned using File System Objects, but I haven't yet
experimented in that arena. Code:

View 2 Replies View Related

JQuery :: Load Not Working Only Within A Certain Company's Network

Jan 21, 2011

I am using a straightforward jquery.load() command which loads a set of html content into another HTML. I have tested this functionality across multiple browser from multiple computers in multiple locations, and it works fine, but for some reason within my client's office network, ajax content does not load. No browser errors are thrown. All I can tell is that within safari, for example, I will get a "cancelled" message in the activity log.

View 6 Replies View Related

Search Multiple Intranet Pages With One Form?

Jun 24, 2011

There are multiple intranet pages with a list of names on them that are updated regularly.At the moment, there is no easy way to check if a name is on the pages without going in to each one at a time and searching them individually.

Is there a javascript script I could use to search all of the pages at the same time, and if a match is found, open the relevant page and highlight the result?

View 4 Replies View Related

ActiveX - How To Save Excel Workbook To Network

Jul 1, 2010

I have an ActiveX Javascript function, that pulls data from an HTML table and then populates an Excel Workbook. This works OK, but I need to save the workbook to a network path. I have successfully saved it locally:

Code:
// Save the Excel Workbook
xlBook.SaveAs("C:\TEST.XLSX");
But this does not:

Code:
// Save the Excel Workbook
xlBook.SaveAs("\Server\Projects\TEST.XLSX");

When attempting this, I get this error:
SaveAs method of Workbook class failed
Which refers to the above. I have tried different variations, but with little success (sometimes the path will default to the Server's 'My Documents'/'User Shared' folder, with the filename:
ServerProjectsTEST.XLSX

View 5 Replies View Related

Script To Open A DOS Command Window And Run Exe On Client (INTRANET)

Jul 20, 2005

I have an asp.net app running on an Intranet. From one of my aspx
pages I would like to run a javascript that will run the following
command OUTSIDE of the IIS/asp.net environment on the CLIENT machine
(remember, a controlled Intranet!). Is this possible? This windows
program needs to be opened and data entered periodically while using
the asp.net app as well.

The exe runs in a dos command window, tied to a Citrix ica file.

C:Program FilesCitrixICA Clientwfica32.exe ciq.ica

View 11 Replies View Related

JQuery :: IE6 - Replacing All Of My Standard Js In A Massive Intranet PHP Application

Feb 5, 2010

I have been using jQuery for only a few weeks now, replacing all of my standard js in a massive Intranet PHP application with lovely and space-saving jQuery. However, I've been using FF to write and test code while the company standard is IE6. Nothing works in IE6 - nada, zip, zilch. It bugs out on the very first call to the js file and wants me to begin debugging. Am I correct in assuming that I'm going to have to go back to regular js? I'd love to get the company to upgrade to IE7 - I've not seen ANY complaints about IE7 and jQuery.

View 5 Replies View Related

Open Local File (Spreadsheet Or Doc) On Company Network?

Oct 17, 2011

I have text area that includes the full path for a local file on our company network. The files are usually excel sheets or docs. How can I have it so when they clicks the file it opens the local file?

View 4 Replies View Related

Layout Of Intranet Website Was Change When Access It On Different Computers

Oct 27, 2010

Since the client user has no totally installed flash player in their computer, so that No need to detect if they have installed flash player. I try to create an alert and I found out that it�s impossible to put a link in the alert. Now I remove the flash installer in my computer, so that the flash in my webpage become a box. I want to happen when they open my webpage that contains a flash; an alert or message on the top was appearing saying that �You do not have flash installed in your computer. Follow this link to get the installer. I try it using alert but the link is impossible to appear.

View 2 Replies View Related

Printer Settings

Jul 23, 2005

I have a problem with printer settings.

I want to let users to print an automatic generated image from a web page.
the problem is that the image is big (little smaller than A4) and if I print
the page from "File --> Print" the image is automatically resized or printed
in more than one page, if I set the page properties from the File menu I can
reduce print margin and cut off header and footer, and then it works fine.
So I would like to set page properties form javascript to let users print
the image with right dimensions.

View 2 Replies View Related

Printer Freindly

Feb 23, 2006

The coloumns of the tables in my jsp page have links on them for sorting. The same table is displayed in the printer freindly version but i want to disable these sorting links on that printer freindly page.

View 1 Replies View Related

External Js File Stops Working When On Network Drive / Sort It?

Mar 5, 2009

I have made aa simple offline website to be used as an intranet. This is made up of an html file and a seperate js file.

While testing, i had the html on my c: drive and the one line js file sitting on a network drive (g - everything worked how it should.

I then put the html onto g: drive and find that the part that the js file controls no longer works...

All my file paths are the same and point to the right place but for some reason the js doesn't work.

View 5 Replies View Related

Printer Friendly Page

Aug 4, 2006

I have a print button in PHP page which using javascript
window.print() to print web page.

However , when user click "print" , the print preview display that the
page cut-off and alignment is out.

Read on regarding the matter , and found that is not the issue of PHP .
Some users recommend to me to use CSS and HTML to create printer
friendly page.
However my page is extension is in php , can i use CSS and HTML to
create printer friendly page?

View 2 Replies View Related

Output From Web To Label Printer

Jul 20, 2005

I need to take text from a database, turn it into a barcode from the
Web and print to a Zebra Z4M barcode printer. I am stuck at two
separate approaches.

1. Use ZPL II (Zebra's proprietary language to command the printer)
which is executed at a DOS Prompt with "COPY BarCode.txt LPT1" Is
there any way to run that from the web. Also, is there any other
method of sending the information in the text file to the printer?

2. Use some sort of ActiveX object to compile a barcode label image,
then use another ActiveX object to remove the Header/Footer and
Margins from the IE printout. I have found ActiveX objects that can
compile the image, but have not found anything to block out the
Header/Footer and Margins.

View 3 Replies View Related

How To Print A Image To Printer

Apr 30, 2010

I have one image (sampleImage.png).. Already i connected my pc to printer....Manually i open the image and select print option , then i got image from printer....Now i want print image using javascript....

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

[code]....

View 3 Replies View Related

C To F Temperature Printer - Conversion

Apr 9, 2010

so my professor suddenly took a left turn in class and we jumped from using HTML and CSS to programing in Javascript. It's not even covered in the book we're using for a text book. So I'm having some problems with it (big surprise right?) My assignment: Write a Java Script that will print out the Temperature in Celcius from 0 to 35, AND the corrosponding temperature in Fahrenheit. So basically it would generate the following:

0 Degrees in Celcius is Equivalent to 5 Degrees Fahrenheit
1 Degrees in Celcius is Equivalent to 6.125 Degrees Fahrenheit
2 Degrees in Celcius is Equivalent to 7.25 Degrees Fahrenheit
3 Degrees in Celcius is Equivalent to 8.375 Degrees Fahrenheit and all the way down to 35 degrees.

Here's the code I have so far:

[Code]....

View 4 Replies View Related

Control Printer Page Size?

Apr 21, 2010

I'm battling to print labels on a dot matrix printer. The available page sizes are all bigger than a single label and I can't make custom page sizes on this printer (panasonic KX-P1150). Whenever I print a label, the printer form feeds the label paper and does not stop after the label. I have googled and see that printer comands can be send directly to the printer with ActiveX controls from inside a javascript but the only examples I found changed the orientation etc. None changed the page size or disabled the form feed.

View 6 Replies View Related

Enable Printer Service Through Javascript

Nov 14, 2006

while login i am getting username & password.

if it is correct then i want to enable printer service.

my system having printer connection. how to disable this & enable this

through code. i didn't any way in php.

Is it possible in javascript?

View 9 Replies View Related

JQuery :: Install On IE7 - 1000+ Workstations - Users Accessing The Site From A Very Slow Network

Feb 4, 2011

I am about to launch a SharePoint site with thousands of users accessing the site from a very, very slow network. Two questions. Is there a way to 'install' jquery so that it doesn't download every time they access the site?

_All_ users are on the same domain and are using IE7. Once they download JQuery on the initial page visit, does it still redownload the file every time they access the site? Temporary internet files don't get cleared after each session, so I'm assuming it doesn't get re-downloaded.

View 2 Replies View Related

Print On Pre-printed Reciept Using DOT Matrix Printer?

Apr 5, 2010

want to print some data using dot matrix printer on pre printed receipts,am using PHP and MYSQL database am getting data FROM DB , now am not getting how to align it, how to print using java script, exactly on those boxes on pre printed reciepts , please any provide me the code

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved