Environment variables not seen in the application when it is started as a Windows service RRS feed

  • Question

  • I have set an envrionment variable (through registry modifications and propagated a WM_SETTINGCHANGE broadcast). When the application is started from the command line it sees the env. variable however if the application is started as a service it would not see this environment variable.


    Any ideas how to make the environment visible in the service?



    net start myapp   (MYENV variable is not set here)

    c:\app\bin\myapp  (MYENV variable could be seen here)



    Wednesday, August 1, 2007 12:19 AM