Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > executing from command line

Reply
Thread Tools

executing from command line

 
 
Monkey Man
Guest
Posts: n/a
 
      02-05-2004

Hey there,
I have a perl script that i would like to run it on a windows server. Since
there is no command line with windows, i want to execute script from a web
page. Is that possible? Or am i just dreaming?


 
Reply With Quote
 
 
 
 
A. Sinan Unur
Guest
Posts: n/a
 
      02-05-2004
"Monkey Man" <(E-Mail Removed)> wrote in
news:luuUb.9762$(E-Mail Removed) m:

>
> Hey there,
> I have a perl script that i would like to run it on a windows server.
> Since there is no command line with windows, i want to execute script
> from a web page. Is that possible? Or am i just dreaming?



You seem to have no idea what you are talking about. Please try to define
the question properly. In doing so, either you will find the answer
yourself, or you'll be helping others help you.

Start -> Run -> command <enter> (Win 9x)
Start -> Run -> cmd <enter> (Win NT,2K,XP)


--
A. Sinan Unur
http://www.velocityreviews.com/forums/(E-Mail Removed) (reverse each component for email address)
 
Reply With Quote
 
 
 
 
David K. Wall
Guest
Posts: n/a
 
      02-05-2004
Monkey Man <(E-Mail Removed)> wrote:

> I have a perl script that i would like to run it on a windows server.
> Since there is no command line with windows,


Yes there is.

> i want to execute script
> from a web page. Is that possible?


Yes. Sounds like you may want to do CGI. Search the web for CGI FAQ for
more information.

CGI questions should be posted to comp.infosystems.authoring.cgi.

> Or am i just dreaming?


Maybe.

--
David Wall
 
Reply With Quote
 
David K. Wall
Guest
Posts: n/a
 
      02-05-2004
I wrote:

> CGI questions should be posted to comp.infosystems.authoring.cgi.


Oops, make that comp.infosystems.www.authoring.cgi
 
Reply With Quote
 
Chris Mattern
Guest
Posts: n/a
 
      02-05-2004
Monkey Man wrote:
> Hey there,
> I have a perl script that i would like to run it on a windows server. Since
> there is no command line with windows,


What the devil ever gave you the impression that there is no command line
with Windows?

Chris Mattern

 
Reply With Quote
 
Brian McCauley
Guest
Posts: n/a
 
      02-05-2004
Chris Mattern <(E-Mail Removed)> writes:

> Monkey Man wrote:
> > Hey there,
> > I have a perl script that i would like to run it on a windows server. Since
> > there is no command line with windows,

>
> What the devil ever gave you the impression that there is no command line
> with Windows?


I think he meant no remote access to the command line (like
rlogind/telnetd/sshd as you might find on a real operating system).

These don't come as standard on Windows but you can get them I think.

Anyhow, this has nothing to do with Perl.

--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      02-05-2004
Monkey Man wrote:
> I have a perl script that i would like to run it on a windows server.
> Since there is no command line with windows,


Really? Since when?
It may not be the most powerful or useful shell, but cmd.exe and command.com
look like command line shells to me.

> i want to execute script
> from a web page. Is that possible?


Well, sure, but why go the difficult route, including all those security
issues.

> Or am i just dreaming?


Well, yes, although on a different topic then you thought.

jue


 
Reply With Quote
 
Chris
Guest
Posts: n/a
 
      02-06-2004
Monkey Man wrote:
> Hey there,
> I have a perl script that i would like to run it on a windows server. Since
> there is no command line with windows, i want to execute script from a web
> page. Is that possible? Or am i just dreaming?
>


I think Brian McCauley successfully interpretted your question here, and
now you can, with his help, receive a reasonable answer.

Yes, you can do this with Windows (assuming Brian is right and I think
he is -- you want to know if you can host a web page that executes a
command on another machine and writes the results of the commend
executed on the remote machine to a web page), but just be aware you are
opening up a (huge) security hole on the remote machine when you do this.

On Windows, you can do this natively in ASP, or you can do it through a
Perl CGI script.

See these programs for direction here:

CGI:
http://www.technologease.com/cgi-bin...tid=2&progid=3

ASP:
http://www.technologease.com/cgi-bin...tid=5&progid=1

Both are written in Perl. One is CGI and the other requires the
PerlScript Classic ASP engine installed. If you want to (horrors) do
this in VBScript, then the essential code is:

Sub Shell( strCmd )
Set WshShell = Server.CreateObject( "WScript.Shell" )
Set oExec = WshShell.Exec( "%COMSPEC% /c " & strCmd )
Set oExec = Nothing
Set WshShell = Noting
End Sub

I'll leave it to you to translate the complete Perl examples I gave you
above into VBScript using the above fragment if you want since this IS a
Perl NG and other than providing you with Perl code to do what (I think)
you want, this has nothing to do with Perl. (I should be shot for
posting VB code, probably.)

I would post a disclaimer about you opening up some huge security hole
using the above code, but since your target is a Windows box, no
disclaimer will be necessary since Windows is basically Swiss Cheese
right out of the box as it is... 8-( But don't blame me if you get
into trouble with the above code. I run that code, but locked down
(which I won't get into here.)

Finally, Windows DOES have a remote command utility called RCMD which
you can install from the Windows Resource Kit CD...

Chris
-----
Chris Olive
chris -at- --spammers-are-vermin-- technologEase -dot- com
http://www.technologEase.com
(pronounced "technologies")
 
Reply With Quote
 
Eric SALGON
Guest
Posts: n/a
 
      02-11-2004
That's right, if fact it's a way to run a command remotely. But it works now
!!!

Basically the problem was that I'm trying to execute a system command with an
"anonymous" account. With an administrative account who has right to log on
locally on the server, it's much better (of course ...)

I have appreciated your efficient help

Thanks to all

Eric


In article <LCEUb.19176$(E-Mail Removed)> , (E-Mail Removed)
says...
>
>Monkey Man wrote:
>> Hey there,
>> I have a perl script that i would like to run it on a windows server.

Since
>> there is no command line with windows, i want to execute script from a web
>> page. Is that possible? Or am i just dreaming?
>>

>
>I think Brian McCauley successfully interpretted your question here, and
>now you can, with his help, receive a reasonable answer.
>
>Yes, you can do this with Windows (assuming Brian is right and I think
>he is -- you want to know if you can host a web page that executes a
>command on another machine and writes the results of the commend
>executed on the remote machine to a web page), but just be aware you are
>opening up a (huge) security hole on the remote machine when you do this.
>
>On Windows, you can do this natively in ASP, or you can do it through a
>Perl CGI script.
>
>See these programs for direction here:
>
>CGI:
>http://www.technologease.com/cgi-bin...tmpl=listing&s

etid=2&progid=3
>
>ASP:
>http://www.technologease.com/cgi-bin...tmpl=listing&s

etid=5&progid=1
>
>Both are written in Perl. One is CGI and the other requires the
>PerlScript Classic ASP engine installed. If you want to (horrors) do
>this in VBScript, then the essential code is:
>
>Sub Shell( strCmd )
> Set WshShell = Server.CreateObject( "WScript.Shell" )
> Set oExec = WshShell.Exec( "%COMSPEC% /c " & strCmd )
> Set oExec = Nothing
> Set WshShell = Noting
>End Sub
>
>I'll leave it to you to translate the complete Perl examples I gave you
>above into VBScript using the above fragment if you want since this IS a
>Perl NG and other than providing you with Perl code to do what (I think)
>you want, this has nothing to do with Perl. (I should be shot for
>posting VB code, probably.)
>
>I would post a disclaimer about you opening up some huge security hole
>using the above code, but since your target is a Windows box, no
>disclaimer will be necessary since Windows is basically Swiss Cheese
>right out of the box as it is... 8-( But don't blame me if you get
>into trouble with the above code. I run that code, but locked down
>(which I won't get into here.)
>
>Finally, Windows DOES have a remote command utility called RCMD which
>you can install from the Windows Resource Kit CD...
>
>Chris
>-----
>Chris Olive
>chris -at- --spammers-are-vermin-- technologEase -dot- com
>http://www.technologEase.com
>(pronounced "technologies")


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing Command Line In C# jerry8989 Software 0 12-04-2008 08:05 PM
Executing a Java application from command line Sharp Tool Java 7 07-20-2005 12:10 AM
Executing a string related to source code, not the command line Arun Java 4 01-03-2005 03:26 PM
Executing a command line applications... Brad Pears ASP General 18 10-01-2004 08:07 PM
Perl CGI executing command line functions Nick Perl Misc 14 10-03-2003 03:05 PM



Advertisments