Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Re: Execute Operating system commands


Message #1 by "Alice Claussen" <wilice@i...> on Tue, 11 Dec 2001 15:14:08
That's the best you can do unless they have very low security, otherwise you 
could run any program you wanted by placing a link and automatically calling 
it from script.
Joe


>From: "Alice Claussen" <wilice@i...>
>Reply-To: "javascript" <javascript@p...>
>To: "javascript" <javascript@p...>
>Subject: [javascript] Re: Execute Operating system commands
>Date: Tue, 11 Dec 2001 15:14:08
>
>Hi,
>I tryed to use <a href="c:\program.bat">Run program</a> but the user gets
>a download dialog, to download the program.bat file, not run it.
>What should I do?
>Hope you can help me,
>Alice Claussen
>
> > Hi,
> >
> > I do not know a way of running system files using javascript, unless you
> > link to them in an A tag:
> > <a href="c:\program.bat">Run program</a>
> >
> > The other way is to use VBScript, which is unfortunately IE only.
> > To do this use the following:
> >
> > <script language="vbscript">
> > Set WShell = CreateObject("WScript.Shell")  ' create a shell object
> > WShell.Run "c:\program.bat"                 ' execute a command
> > </script>
> >
> > Of course this is entirely dependent on the user's security settings.
> > If the settings allow the object to be made, you can do a lot with it.
> > If you want to find out more, try the VBScript Programmers Reference
> > (ISBN: 1861002718). This has loads on all parts of VBScript.
> >
> > Philip
> >
> > > Hi
> > >
> > > Can anyone help me on how to execute operating system commands(e.g.
>run
> > a
> > > batch file) on the client system from a button on a web page?
> > >
> > > Thanks in advance
> > >
> > > Amit.
>


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


  Return to Index