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
It is not uncommon for the current working directory of a process to be different from the directory in which the executable lives. In this case, my guess would be that the current working directory is that of the process that manages services, and all services start up with that as their current working directory. > > 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\)? Finding the directory in which a script lives is a FAQ, see 'perldoc -q lives'. I suggest trying that first, assuming of course that the variable $0 doesn't contain anything useful. HTH -- Brian Raven ================================= Atos Euronext Market Solutions Disclaimer ================================= The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosure, modification, and/or distribution of this email may be unlawful. If you have received this email in error, please notify the sender immediately and delete it from your system. The views expressed in this message do not necessarily reflect those of Atos Euronext Market Solutions. L'information contenue dans cet e-mail est confidentielle et uniquement destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail vous parvient par erreur, nous vous prions de bien vouloir prevenir l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre systeme. Le contenu de ce message electronique ne represente pas necessairement la position ou le point de vue d'Atos Euronext Market Solutions. _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
