Re: executing from command line

From: Eric SALGON (eric.salgon_at_mane.com)
Date: 02/11/04


Date: Wed, 11 Feb 2004 07:03:07 +0000 (UTC)

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$xq.8881@newssvr16.news.prodigy.com>, ceo@nospan.on.net
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/listing.cgi?config=resume&tmpl=listing&s
etid=2&progid=3
>
>ASP:
>http://www.technologease.com/cgi-bin/listing.cgi?config=resume&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")



Relevant Pages

  • Thanks for the comments Jan. 25, 2006
    ... "shadow" operating system which is running behind Windows. ... Perl can then collect data from that program and do ... that by sending longer strings etc. to the Windows clipboard and then having ... SendKeysuse a Ctrl V command to paste the information to the text editor ...
    (comp.lang.perl.misc)
  • Re: Linux cant see my Windows machine
    ... The good news is that I finally got the printing to work on the remote windows ... computer printer using the command line prompts you and others suggested to me. ...
    (comp.os.linux.security)
  • Re: perl in Windows: using the "Send To" folder and perl
    ... this is not strictly a Perl question but ... ... > marked are supplied on the command line to the executable i.e. ... > I create my executable by writing a .bat file which in turn supplies ... You do not mention which Windows command shell you are using. ...
    (comp.lang.perl.misc)
  • Re: 500 Cant connect to search.cpan.org:80 (Bad protocol tcp) at web.plline 24.
    ... :>I beg to differ... ... be interpreted as an internal Perl command or a shell one). ... : of Windows APIs capabilities. ...
    (comp.lang.perl.misc)
  • RE: Could anyone please answer a simple PERL question.
    ... I have added a note regarding Windows XP at the end of it. ... I have assumed that you have installed the Active State perl with all the ... One way to get around this is to open a command window. ... You need to get to the "file types" section of windows - I'm in NT right ...
    (perl.beginners)