If it works ok in a console but not via cgi could it be a permissions or
environment issue? If you are using apache what account does it run under. I
have had mixed results running some processes under cgi. Why not just create
a batch on the fly and/or grab Russinovich's psexec.exe and use it to
execute the batch (might not even be necessary). For instance, if I'm stuck
and the machine is reasonably secure (behind a firewall or filtering router)
I will often do something like this :
 
open OUT, '>c:/temp/' . "$$" . '.bat';
print OUT "[EMAIL PROTECTED] off";
print OUT "do some stuff";
close (OUT)
$result = `c:/psexec.exe -u user -p password c:/temp/$$.bat`;

If you can get that to work ok it probably has to do with the environment.
You might be able to keep it pure PERL (or just use psexec if you are happy)
by using Dave Roth's Win32::Adminmisc::CrateProcess instead of
Win32::Process.
 
-M

 
> sub CopyProcess {
>     my ($strSource, $strDest) = @_;
>     my $obj;
> 
>     my $command = "xcopy ".$strSource." ".$strDest." /f /u /y";
> 
>     Win32::Process::Create ($obj,
>        "c:/windows/system32/cmd.exe",
>        "cmd /c ".$command,
>        1,
>        NORMAL_PRIORITY_CLASS,
>        '.'
>        ) || die "Win32::Process::Create: $! ($^E)";
>     return $obj;
> }
> This all works fine in a console... so once again... I'm afraid that this
> sort of thing doesn't work right when handled as a CGI...
> 
> Thoughts?
> 
> Andy Speagle
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to