Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 23rd, 2004, 02:30 PM
Authorized User
 
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default Open Notepad from within an HTML page?

I would like to place a link on several of my web pages such as: Click here to take notes. When the user clicked on this link the notepad program would open.

Could you code this out for me, please.

__________________
Rudy
 
Old April 23rd, 2004, 02:50 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

It depends what system the user is using. If the user uses ME, you would make the location c:\windows\notepad.exe. If it were 2000 you would make the location c:\winnt\notepad.exe.

It all depends on what OS the client is using, so you would probably have to detect that before you open notepad.

HTH,

Snib

<><
 
Old April 26th, 2004, 10:02 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Larry,

Chances are that changing the location to c:\[whatever] will return an "Access Denied" or similar error.

You could create a shell object & run notepad from there, something like...

function TakeNotes(){
    var o = new ActiveXObject("WScript.Shell");
    o.Run("notepad.exe");
    o = null;
}

However a user would have need to have notepad & WSH installed on their machine, plus allow you to run unsafe controls in your page for you to do this - fine if everyone trusts your site (intranet maybe), but otherwise IMHO only a madman would allow this in todays virus ridden World.

HTH,

Chris






Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to open notepad and command promt ketAccess Access VBA 1 March 9th, 2007 05:37 AM
i need to open powerpoint in the html page Fatma General .NET 0 April 5th, 2006 04:13 PM
Print html page using window.open manish.sharma04 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 0 April 1st, 2006 03:20 AM
Open Excel Sheet in HTML pankajm HTML Code Clinic 1 January 3rd, 2006 04:18 PM
Open framed html and target frame fs22 Javascript How-To 2 May 5th, 2004 04:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.