redrafiki has asked for the wisdom of the Perl Monks concerning the following question:
#!/perl/bin/perl -wT use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; $ENV{'PATH'} = 'C:\\Temp\\'; #Declare the variables my $result; my $staging_area = param('staging'); my $directory = param('directory'); my $user_id = param('userid'); my $passwd = param('passwd'); my $store = param('store'); #Attach the store directory to the diectory variable $directory = $directory . "/" . $store; #Set the directory where pscp.exe resides my $pscp_dir = 'C:\\Temp\\'; #Construct the pscp command with the right arguments my $command = $pscp_dir . "pscp.exe -batch -pw " . $passwd . " " . $us +er_id . "@" . $staging_area . ":" . $directory . "/" . $store . "*.tg +z " . $pscp_dir; #Execute the command system($command); if ( $? == -1 ) { $result = "command failed: $!\n"; } print header; print start_html("Thank You"); print h2("Thank You"); print "$command<br>\n"; print "$result<br>\n"; print end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Running pscp from cgi-script in Windows
by VinsWorldcom (Prior) on Oct 26, 2010 at 20:47 UTC | |
by redrafiki (Initiate) on Oct 26, 2010 at 22:54 UTC | |
|
Re: Running pscp from cgi-script in Windows
by locked_user sundialsvc4 (Abbot) on Oct 26, 2010 at 23:18 UTC | |
|
Re: Running pscp from cgi-script in Windows
by umasuresh (Hermit) on Oct 26, 2010 at 20:32 UTC | |
|
Re: Running pscp from cgi-script in Windows
by Plankton (Vicar) on Oct 26, 2010 at 23:23 UTC | |
by redrafiki (Initiate) on Oct 27, 2010 at 14:24 UTC |