Bill,

I tried your suggestions, but they didn't work.

I did, however, manage to come up with two solutions.

The first is the simplest. And that just involves setting the PATH environment variable to the absolute path of the subdirectory where the executable resides and then doing the system call to the executable. The system call will now be able to find the executable.

$ENV{'PATH'}="C:/inetpub/web/sub";
system (anyprogram.exe arg1");


The second way is to create a batch file in the web root top level that contains the absolute full path to the executable and the argument(s):
C:/inetpub/web/sub/anyprogram.exe arg1


Then do a system call to the batch file:
system ("info.bat");

I prefer the first method.

Thanks again Bill.

Paul


Paul Appleby wrote:

 I am trying to make a system call to an executable that is in a
 subdirectory in the web root.

For example, if the executable is in the top level of the web root, this works:
system ("anyprogram.exe arg1");


 But if the executable is in a subdirectory, it won't work when I try
 a path to the executable.
 For example, this doesn't work:
> system ("C:/inetpub/web/sub/anyprogram.exe arg1");

I'm using Perl 5.6.1 on Windows 2000 and IIS 5.

A couple of things to try :

Not sure what the current directory is when running IIS, you could
print out the current directory to see where you are to start with
(see Cwd module).

You could try using \'s instead of /'s, may make a difference depending
on what shell is being used.

You could try a relative path rather than absolute :
        system 'sub\anyprogram.exe arg1';

--
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)


--
Sincerely,

Paul Appleby

(416) 530-0070
http://www.paulappleby.com
http://myspider.ca
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to