Solved

Edit clients registry with Javascript

Posted on 2004-08-16
5
668 Views
Last Modified: 2012-06-21
Problem:
Need javascript, maybe active x, code to manipulate clients registry and change the default printer to one specified in code.

Scenario:
Intranet Order Entry System, wish to have full control over printing, have active X script which enables direct printing to Default Printer. However since it only prints to default printer I need code to edit clients registry to change the default printer as well, depending on which page they are printing; IE: user prints quotes - sends to regular laser printer, with quote, labels are also printed, the code will change the default printer registry key to reflect the label printer, print the labels, and then write original values back to the key.

Goal:
User clicks print, writes new default printer values to the registry for printer, prints documents, redirects to a new page (to confirm printing completion) where it rewrites old default printer values.

Notes:
the registry key to edit default printers on Windows XP Pro is found HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device
0
Comment
Question by:LTY83
5 Comments
 
LVL 1

Accepted Solution

by:
Gonavitch earned 500 total points
ID: 11812306
Your trying to do something that is completely impossible with JavaScript. Editing the users registery without letting them know is very and can result in your site to be shut down. Also probally can't be done with any type of web-langauge.
Sorry to be a little meany here but it can't be done!

Regards,
Jamison
0
 
LVL 4

Author Comment

by:LTY83
ID: 11812553
This is for an INTRANET system so it won't be live on the web. I know it can be done, but on which language is the question. I think I have a couple ideas on how to fix this. Thanks
0
 
LVL 7

Expert Comment

by:mmarksbury
ID: 12138446
JavaScript has built in functions to prohibit this.  If it was possible, it would be a HUGE security issue.

Sounds like you should build an activeX control that does this.  You see this type of activity from adware sites all the time.  They force you to download a small .exe file that creates registry entries, installs programs, etc.  If you're browser's security settings are low enough, this all happens in the background.

Good Luck.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

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

13 Experts available now in Live!

Get 1:1 Help Now