From: Thomas 'PointedEars' Lahn on
Bwig Zomberi wrote:

> Swifty wrote:
>> I know that JavaScript goes out of its way to make it impossible for
>> local commands to be executed, but in a situation where I own
>> everything; the server, the webpage, the local system, the browser
>> (and anything else that you can think of), is there a way to execute a
>> local command?
>
> In IE, add the server to your Local Internet zone.

Better yet, create a HTA or XUL application.

>> To give you the specifics: The webpage is the source control for all
>> the HTML and CGI scripts on our department server (remote from me/my
>> PC). After I've checked out the file that I want to work on, it would
>> be nice if that file could be opened on my local system. To do this,
>> the JavaScript running on my local system would have to execute a
>> command such as:
>>
>> "C:\Program Fies\Editor\Edit.exe" "L:\path\to\file\filename"
>
> Set security level to Low.
>
> Internet Options -> Security -> Security Level For this Zone

*Never* *ever* do that if you value your data.

>> I realise that I'll probably have to make some adjustments to my
>> browser to accommodate this, but I prefer to keep these to a minimum,
>> as I use all sorts of different browsers, and I'd never be certain
>> which one I'd be using.
>
> Only IE will allow that.

No, every browser with ActiveX/COM support on 32+ bit Windows will allow
that.

> Here is the code I tried - Modified from
> POinted Ears.

With a small o and without the space, please.

> <html>
> <head>
> <title></title>

Ouch.

<http://validator.w3.org/>
<http://www.w3.org/QA/Tips/good-titles>

> <script type="text/jscript" language="JScript">
> function runEditor()
> {
> try {
>
> var wshShell = new ActiveXObject("WScript.Shell");
> wshShell.Run("notepad.exe");
> } catch(err) {
> alert(err);

window.alert(e.message);

(and the like)

> [...]
> <input type="button" value="start" onclick="runEditor();">

Elements like this should be generated dynamically.


PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
From: Thomas 'PointedEars' Lahn on
Dr J R Stockton wrote:

> That having been said : I have a web page which needs a file (in the
> same domain) whose content needs to be what DIR /B /S currently
> gives - so if there is a solution I'd like to hear of it.

You will need to be more specific.

Without further information, you probably want to use a server-side script
to run DIR /B /S to generate either resource dynamically. If the script
generates the whole "web page" including the directory listing, you're done.
If it generates only the directory listing, you need to refer to the server-
side script through its URI, i.e. via link, client-side script, window,
frame, iframe, or XHR, in the "web page".

For example, I have written a CGI bash script that generates what diff(1)
currently gives for two files, referred to by textual link in an HTML
document, which should not be too hard to adapt for WinDOS.


HTH

PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
From: Bwig Zomberi on
Thomas 'PointedEars' Lahn wrote:
> Bwig Zomberi wrote:
>
>> Swifty wrote:
>>> I know that JavaScript goes out of its way to make it impossible for
>>> local commands to be executed, but in a situation where I own
>>> everything; the server, the webpage, the local system, the browser
>>> (and anything else that you can think of), is there a way to execute a
>>> local command?
>>
>> In IE, add the server to your Local Internet zone.
>
> Better yet, create a HTA or XUL application.

To start with, ordinary HTML page would do.

>
>>> To give you the specifics: The webpage is the source control for all
>>> the HTML and CGI scripts on our department server (remote from me/my
>>> PC). After I've checked out the file that I want to work on, it would
>>> be nice if that file could be opened on my local system. To do this,
>>> the JavaScript running on my local system would have to execute a
>>> command such as:
>>>
>>> "C:\Program Fies\Editor\Edit.exe" "L:\path\to\file\filename"
>>
>> Set security level to Low.
>>
>> Internet Options -> Security -> Security Level For this Zone
>
> *Never* *ever* do that if you value your data.

Swifty's approach to the problem is totally wrong in the first place. He
wants to run system commands off a web page. He wants his poison. Give
it to him.

>
>>> I realise that I'll probably have to make some adjustments to my
>>> browser to accommodate this, but I prefer to keep these to a minimum,
>>> as I use all sorts of different browsers, and I'd never be certain
>>> which one I'd be using.
>>
>> Only IE will allow that.
>
> No, every browser with ActiveX/COM support on 32+ bit Windows will allow
> that.

Tell me how to do it in Firefox. Frankly, I do not know. And, why only
32-bit Windows?



--
Bwig Zomberi
From: Thomas 'PointedEars' Lahn on
Bwig Zomberi wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Bwig Zomberi wrote:
>>> Swifty wrote:
>>>> I know that JavaScript goes out of its way to make it impossible for
>>>> local commands to be executed, but in a situation where I own
>>>> everything; the server, the webpage, the local system, the browser
>>>> (and anything else that you can think of), is there a way to execute a
>>>> local command?
>>> In IE, add the server to your Local Internet zone.
>> Better yet, create a HTA or XUL application.
>
> To start with, ordinary HTML page would do.

No, it would not.

>>>> To give you the specifics: The webpage is the source control for all
>>>> the HTML and CGI scripts on our department server (remote from me/my
>>>> PC). After I've checked out the file that I want to work on, it would
>>>> be nice if that file could be opened on my local system. To do this,
>>>> the JavaScript running on my local system would have to execute a
>>>> command such as:
>>>>
>>>> "C:\Program Fies\Editor\Edit.exe" "L:\path\to\file\filename"
>>> Set security level to Low.
>>>
>>> Internet Options -> Security -> Security Level For this Zone
>> *Never* *ever* do that if you value your data.
>
> Swifty's approach to the problem is totally wrong in the first place.

No argument about that.

> He wants to run system commands off a web page. He wants his poison.
> Give it to him.

No, that is certainly NOT how things work around here!

<http://www.catb.org/~esr/faqs/smart-questions.html#id383614>

>>>> I realise that I'll probably have to make some adjustments to my
>>>> browser to accommodate this, but I prefer to keep these to a minimum,
>>>> as I use all sorts of different browsers, and I'd never be certain
>>>> which one I'd be using.
>>> Only IE will allow that.
>> No, every browser with ActiveX/COM support on 32+ bit Windows will allow
>> that.
>
> Tell me how to do it in Firefox.

AFAIK there is no ActiveX plugin that is compatible with newer versions of
Firefox. There is one for Firefox 1.5- and other corresponding Mozilla-
based browsers.¹ Whether it can deal with the Windows Scripting Host I do
not know.

However, the point was that it is not really a matter of the browser; in
particular, all Windows browsers that can use MSHTML should support that.

> Frankly, I do not know. And, why only 32-bit Windows?

I said 32_+_ to include 64, because I don't know of a Windows Scripting
Host for 16-bit Windows. Do you?


PointedEars
___________
¹ <http://www.iol.ie/~locka/mozilla/plugin.htm>
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7(a)news.demon.co.uk> (2004)
From: Bwig Zomberi on
Thomas 'PointedEars' Lahn wrote:
>
>> He wants to run system commands off a web page. He wants his poison.
>> Give it to him.
>
> No, that is certainly NOT how things work around here!
>
> <http://www.catb.org/~esr/faqs/smart-questions.html#id383614>

That is not how I meant it. Sometimes, nothing else would work. Swifty
says he owns everything from the server to the local system. He says he
knows what he is doing.

>>>>> I realise that I'll probably have to make some adjustments to my
>>>>> browser to accommodate this, but I prefer to keep these to a minimum,
>>>>> as I use all sorts of different browsers, and I'd never be certain
>>>>> which one I'd be using.
>>>> Only IE will allow that.
>>> No, every browser with ActiveX/COM support on 32+ bit Windows will allow
>>> that.

Browsers for the Windows platform are Win32 programs and internally deal
with a lot of ActiveX/COM. However, they do not let web pages interact
with ActiveX/COM.


>>
>> Tell me how to do it in Firefox.
>
> AFAIK there is no ActiveX plugin that is compatible with newer versions of
> Firefox. There is one for Firefox 1.5- and other corresponding Mozilla-
> based browsers.¹ Whether it can deal with the Windows Scripting Host I do
> not know.
>
> However, the point was that it is not really a matter of the browser; in
> particular, all Windows browsers that can use MSHTML should support that.
>
>> Frankly, I do not know.

If I remember correctly manufacturers of non-IE browsers refused to
support ActiveX, VBScript, Wscript, and other Microsoft extensions. For
obvious reasons, they supported Flash and Windows Media Player ActiveX
controls in OBJECT/EMBED tags but they never went all the way like IE
had done for signed and unsigned ActiveX controls.

MediaWrap addon for supports ActiveX controls inside Firefox. Makes it
almost like IE. https://addons.mozilla.org/en-US/firefox/addon/1879.


> And, why only 32-bit Windows?
>
> I said 32_+_ to include 64,because I don't know of a Windows Scripting
> Host for 16-bit Windows. Do you?

Wscript was first released for NT4 and Win95. 32-bit or 64-bit it did
not really matter. Older OS had INF and batch file scripting.


--
Bwig Zomberi

First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6
Prev: detect exiting the website
Next: BESEN ES5 implementation