Foo JH wrote:

> Hi all,
> 
> It's like this: I built an executable using PerlSvc, and I install the 
> service like this:
> c:\app\test.exe --install
> 
> In Services, the 'Path to Execute' field shows:
> c:\app\test.exe
> 
> But when I start the service, and I print out the current working 
> directory, it's:
> C:/WINDOWS/system32
> 
> I suspect the packaged executable unpacks itself somewhere, and runs the 
> script in that other directory. How can I get the path where the 
> application is stored (ie. c:\app\)?
> 
> One way is to add it to the argument of the service, which should work, 
> but it's not as elegant...

For a normal script, you would use:

        use FindBin qw($RealScript $RealDir);
        print "$RealDir/$RealScript\n";

Not sure if that still works with a perlsvc .exe.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to