SearchSearch   

shell or system call from JS

 
   Webmaster Forums (Home) -> Javascript RSS
Next:  Best firefox extension idea!  
Author Message
CTG

External


Since: Aug 08, 2007
Posts: 1



(Msg. 1) Posted: Wed Aug 08, 2007 11:11 pm
Post subject: shell or system call from JS
Archived from groups: comp>lang>javascript (more info?)

Hi guys;

Without any documentation , and new to JS coudl some one tell me how a
JS can shell to operating system, call nother program and get back to
what it used to do...

Can the result of the operation be checked as well (if it was
successful or not) ?


Thanks
Back to top
David Mark

External


Since: Aug 06, 2007
Posts: 358



(Msg. 2) Posted: Wed Aug 08, 2007 11:42 pm
Post subject: Re: shell or system call from JS
Archived from groups: per prev. post (more info?)

On Aug 9, 2:32 am, David Dorward <dorw....DeleteThis@gmail.com> wrote:
> On Aug 9, 7:11 am, CTG <BadMul....DeleteThis@gmail.com> wrote:
>
> > Without any documentation , and new to JS coudl some one tell me how a
> > JS can shell to operating system, call nother program and get back to
> > what it used to do...
>
> Well, you presumably can if you are running under WSH, but not if you
> are running under a browser (which most people are).
>

You can do it in a browser, but not under normal security
configurations. In IE you create an ActiveX object
(Shell.Application) and use the shellExecute method. The technique is
only appropriate for a controlled environment like an Intranet.
Back to top
David Dorward

External


Since: Jun 01, 2007
Posts: 51



(Msg. 3) Posted: Thu Aug 09, 2007 6:32 am
Post subject: Re: shell or system call from JS
Archived from groups: per prev. post (more info?)

On Aug 9, 7:11 am, CTG <BadMul....RemoveThis@gmail.com> wrote:

> Without any documentation , and new to JS coudl some one tell me how a
> JS can shell to operating system, call nother program and get back to
> what it used to do...

Well, you presumably can if you are running under WSH, but not if you
are running under a browser (which most people are).

-
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
Back to top
The Magpie

External


Since: Aug 29, 2006
Posts: 28



(Msg. 4) Posted: Fri Aug 10, 2007 5:52 pm
Post subject: Re: shell or system call from JS
Archived from groups: per prev. post (more info?)

CTG wrote:
> Hi guys;
>
> Without any documentation , and new to JS coudl some one tell me how a
> JS can shell to operating system, call nother program and get back to
> what it used to do...
>
> Can the result of the operation be checked as well (if it was
> successful or not) ?
>
Essentially, that is exactly what Javascript was developed *not* to be
able to do. It *can* be permitted to do it, but it depends on what the
code runs in and what the user's PC security settings are. In short,
there is absolutely *no* general-purpose method of doing it.
Back to top
Thomas 'PointedEars' Lahn

External


Since: Sep 05, 2004
Posts: 3405



(Msg. 5) Posted: Fri Aug 10, 2007 7:54 pm
Post subject: Re: shell or system call from JS
Archived from groups: per prev. post (more info?)

The Magpie wrote:
> CTG wrote:
>> Without any documentation , and new to JS coudl some one tell me how a
>> JS can shell to operating system, call nother program and get back to
>> what it used to do...
>>
>> Can the result of the operation be checked as well (if it was
>> successful or not) ?
>
> Essentially, that is exactly what Javascript was developed *not* to be
> able to do.

How do you got that crazy idea?


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Back to top
The Magpie

External


Since: Aug 29, 2006
Posts: 28



(Msg. 6) Posted: Mon Aug 13, 2007 9:34 pm
Post subject: Re: shell or system call from JS
Archived from groups: per prev. post (more info?)

Thomas 'PointedEars' Lahn wrote:
> The Magpie wrote:
>> CTG wrote:
>>> Without any documentation , and new to JS coudl some one tell me how a
>>> JS can shell to operating system, call nother program and get back to
>>> what it used to do...
>>>
>>> Can the result of the operation be checked as well (if it was
>>> successful or not) ?
>> Essentially, that is exactly what Javascript was developed *not* to be
>> able to do.
>
> How do you got that crazy idea?
>
Age, experience and collaborating through my employers with Netscape
on the original design.
Back to top
Thomas 'PointedEars' Lahn

External


Since: Sep 05, 2004
Posts: 3405



(Msg. 7) Posted: Mon Aug 13, 2007 10:53 pm
Post subject: Re: shell or system call from JS
Archived from groups: per prev. post (more info?)

The Magpie wrote:
> Thomas 'PointedEars' Lahn wrote:
>> The Magpie wrote:
>>> CTG wrote:
>>>> Without any documentation , and new to JS coudl some one tell me how a
>>>> JS can shell to operating system, call nother program and get back to
>>>> what it used to do...
>>>>
>>>> Can the result of the operation be checked as well (if it was
>>>> successful or not) ?
>>> Essentially, that is exactly what Javascript was developed *not* to be
>>> able to do.
>> How do you got that crazy idea?
>
> Age, experience and collaborating through my employers with Netscape
> on the original design.

I'd like to see *some* reference material on that, Mrs/M(r)s. Anonymous,
before I am even considering to believe that.

But, whatever your possible connection to Netscape, you are missing the
point. If what you have stated is true, you of all people should know that
JavaScript (and its incarnations) has evolved since Netscape 2.0 from being
a programming language bound to the object model designed for one browser
into an all-purpose programming language that can be used for any means as
long as the execution environment provides the corresponding API. Which
makes especially Gecko-based browsers using XUL, which can do much (maybe
all) of what the OP asked, this successful.

And on Microsoft Windows, the Windows Script Host which can be triggered
from Internet Explorer provides the execution environment and API for
JScript to do all of what the OP asked.


PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>
Back to top
Lee

External


Since: Jun 09, 2004
Posts: 1556



(Msg. 8) Posted: Mon Aug 13, 2007 10:53 pm
Post subject: Re: shell or system call from JS
Archived from groups: per prev. post (more info?)

Thomas 'PointedEars' Lahn said:
>
>The Magpie wrote:
>> Thomas 'PointedEars' Lahn wrote:
>>> The Magpie wrote:
>>>> CTG wrote:
>>>>> Without any documentation , and new to JS coudl some one tell me how a
>>>>> JS can shell to operating system, call nother program and get back to
>>>>> what it used to do...
>>>>>
>>>>> Can the result of the operation be checked as well (if it was
>>>>> successful or not) ?
>>>> Essentially, that is exactly what Javascript was developed *not* to be
>>>> able to do.
>>> How do you got that crazy idea?
>>
>> Age, experience and collaborating through my employers with Netscape
>> on the original design.
>
>I'd like to see *some* reference material on that, Mrs/M(r)s. Anonymous,
>before I am even considering to believe that.
>
>But, whatever your possible connection to Netscape, you are missing the
>point. If what you have stated is true, you of all people should know that
>JavaScript (and its incarnations) has evolved since Netscape 2.0 from being
>a programming language bound to the object model designed for one browser
>into an all-purpose programming language that can be used for any means as
>long as the execution environment provides the corresponding API. Which
>makes especially Gecko-based browsers using XUL, which can do much (maybe
>all) of what the OP asked, this successful.
>
>And on Microsoft Windows, the Windows Script Host which can be triggered
>from Internet Explorer provides the execution environment and API for
>JScript to do all of what the OP asked.

None of which changes the fact that it is exactly the sort of thing
that Javascript was developed *not* to be able to do. The fact that
security has been relaxed since then can't change that fact, and the
fact that it's possible, under very unusual circumstances to do what
the OP wants to do, probably doesn't help him.

When somebody identifies themself as "new to JS", the best answer
is that you can't do that.


--
Back to top
Steve Swift

External


Since: Sep 27, 2006
Posts: 20



(Msg. 9) Posted: Tue Aug 14, 2007 7:20 am
Post subject: Re: shell or system call from JS
Archived from groups: per prev. post (more info?)

> When somebody identifies themself as "new to JS", the best answer
> is that you can't do that.

I've always found that the best *question* normally contains an element
of "I'm certain this cannot be done".

In my experience, that drives all sorts of people to bust their guts
trying to prove me wrong by showing just how it *can* be done. Smile

In the process, I get my answer. I should have taken my degree in
Psychology, not Physics. I did spend a lot of time lurking in the
Psychology department, but that was only because they had better
licenses for their PDP11 software, so always got new releases earlier
than us Physicists.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Back to top
Evertjan.

External


Since: Sep 30, 2005
Posts: 2391



(Msg. 10) Posted: Tue Aug 14, 2007 8:00 am
Post subject: Re: shell or system call from JS
Archived from groups: per prev. post (more info?)

Steve Swift wrote on 14 aug 2007 in comp.lang.javascript:

>> When somebody identifies themself as "new to JS", the best answer
>> is that you can't do that.
>
> I've always found that the best *question* normally contains an element
> of "I'm certain this cannot be done".

Steve, you read Pointed wrongly.

He just ment [if fathoming that is possible] that one should not be "new to
JS" as an excuse of not reading the FAQ, the specs and thinking logically.

That excuse is being reserved for the more experienced under us.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Back to top
Dr J R Stockton

External


Since: May 20, 2007
Posts: 386



(Msg. 11) Posted: Tue Aug 14, 2007 5:10 pm
Post subject: Re: shell or system call from JS
Archived from groups: per prev. post (more info?)

In comp.lang.javascript message <f9qf8c$9u0$1$8300dec7@news.demon.co.uk>
, Mon, 13 Aug 2007 21:34:43, The Magpie <usenet.TakeThisOut@pigsinspace.co.uk>
posted:
>Thomas 'PointedEars' Lahn wrote:

>> How do you got that crazy idea?
>>
>Age, experience and collaborating through my employers with Netscape
>on the original design.


Be aware that Thomas's age is increasing each year by a much greater
percentage than yours is, though in his case the normal consequential
improvements are not in evidence.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Back to top
The Magpie

External


Since: Aug 29, 2006
Posts: 28



(Msg. 12) Posted: Tue Aug 14, 2007 5:33 pm
Post subject: Re: shell or system call from JS
Archived from groups: per prev. post (more info?)

Thomas 'PointedEars' Lahn wrote:
>
> I'd like to see *some* reference material on that, Mrs/M(r)s. Anonymous,
> before I am even considering to believe that.
>
No problem, if you are really interested. But it would be better
outside Usenet.
>
> But, whatever your possible connection to Netscape, you are missing the
> point. If what you have stated is true, you of all people should know that
> JavaScript (and its incarnations) has evolved since Netscape 2.0 from being
> a programming language bound to the object model designed for one browser
> into an all-purpose programming language that can be used for any means as
> long as the execution environment provides the corresponding API. Which
> makes especially Gecko-based browsers using XUL, which can do much (maybe
> all) of what the OP asked, this successful.
>
Absolutely! I agree 100% that it has grown up from effectively a "bit
of a toy" into something very real and very useful and that can do a
hell of a lot more than it was ever imagined it would at the start. No
doubt at all. Except that it can't do what the OP suggested because he
wants OS commands and Javascript is OS neutral.
>
> And on Microsoft Windows, the Windows Script Host which can be triggered
> from Internet Explorer provides the execution environment and API for
> JScript to do all of what the OP asked.
>
Oh sure - here I do agree totally.Other systems that can use
Javascript can certainly trigger specific commands.

I use one myself - I use OpenOffice.org Base to link to a MySQL
database and Javascript macros to fire off embedded triggers. In a
specific environment, you can use it for whatever the environment will
let it do. But that doesn't mean Javascript itself can do it. It can
do it in combination with a tool to extend Javascript's reach.
Back to top
Thomas 'PointedEars' Lahn

External


Since: Sep 05, 2004
Posts: 3405



(Msg. 13) Posted: Tue Aug 14, 2007 6:43 pm
Post subject: Re: shell or system call from JS
Archived from groups: per prev. post (more info?)

The Magpie wrote:
> Thomas 'PointedEars' Lahn wrote:
>> I'd like to see *some* reference material on that, Mrs/M(r)s. Anonymous,
>> before I am even considering to believe that.
>>
> No problem, if you are really interested. But it would be better
> outside Usenet.

Yes, please.

>> And on Microsoft Windows, the Windows Script Host which can be triggered
>> from Internet Explorer provides the execution environment and API for
>> JScript to do all of what the OP asked.
>
> Oh sure - here I do agree totally.Other systems that can use
> Javascript can certainly trigger specific commands.
>
> I use one myself - I use OpenOffice.org Base to link to a MySQL
> database and Javascript macros to fire off embedded triggers. In a
> specific environment, you can use it for whatever the environment will
> let it do. But that doesn't mean Javascript itself can do it. It can
> do it in combination with a tool to extend Javascript's reach.

I think you are attempting tetrapilotomy here. From the Subject "shell or
system call from JS" and the OPs question "How [can] a JS can shell to
operating system, call [a]nother program and get back to what it used to
do...[?]" I would always say that it is possible, under certain conditions.
Because, as I said, the execution environment and the API it provides is
inherently connected to the language implementations. Try to show me some
practically useful script that does not make use of a host object, and you
see what I mean.


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Back to top
Display posts from previous:   
       Webmaster Forums (Home) -> Javascript
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum