JavaScript, window.open and .exe programs (Full Version)

All Forums >> [Web Development] >> Microsoft FrontPage Help



Message


fatlardo -> JavaScript, window.open and .exe programs (11/12/2004 4:31:48)

I'm not sure if this is the right forum to post this in, but here I go.

I'm trying to get my active desktop to open programs such as notepad and word etc. The only problem is I have to use the wondow.open function in JavaScript to do it (Tables and stuff). Is there any way I can use this function to this?

I have tried with the following code:

function accessoriesopena() {
	startoff()
	window.open("file:\\C:\Windows\explore.exe")
}

function accessoriesopenb() {
	startoff()
	window.open("file:\\C:\Windows\notepad.exe")
}

function accessoriesopenc() {
	startoff()
	window.open("file:\\C:\Windows\printers.exe")
                    //Yes, I know it won't work. Notepad's what I'm interested in!!!
}


Startoff() has been defined to get rid of the menu I'm using and works. And the first function seems to work. However, all three of the functions see to be using the first function (if that makes any sense). When I call accessoriespenb() and accessoriesopenc() accessoriesopena() seems to be called, opening windows explorer. And if I change the url of the window.open function in accessoriesopena() to file:\\C:\Windows\ None of the functions work.

I have tried putting an alert into the first function to check whether it is being run, but it is not.

HELP!!!




Giomanach -> RE: JavaScript, window.open and .exe programs (11/12/2004 4:39:09)

Theres a misunderstanding of JS commands here...

window.open is for the browser window, not the local machine, try something like:

window.open(url.htm);
location.go(file//C:\Windows\Notepad.exe);

JavaScript was designed to alter the behvaior of the browser, rather than open local files, yes it has evolved since then, but the above should work




fatlardo -> RE: JavaScript, window.open and .exe programs (11/12/2004 10:16:59)

Done that but it doesnt seen to work.

What is the location.go bit meant to do?
If I can understand that I might be able to work it out for myself.




Giomanach -> RE: JavaScript, window.open and .exe programs (11/12/2004 11:38:05)

location.go tells the browser to find the file (whatever is may be), and go to it...

location.href might work better than location.go





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
7.910156E-02