On Fri, 23 Jun 2006, 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\)?
You can get the full path to your application (including the filename) with
my $exe = PerlSvc::exe();
You can then use File::Basename::dirname() to extract the directory part
from the filename.
Cheers,
-Jan
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs