JSI Tip 0973. How do I set specific environment variables for SRVANY launched applications?

Jerold Schulman

January 5, 1999

1 Min Read
ITPro Today logo in a gray background | ITPro Today

If you require specific/different settings for environment variables in an application that you launch with SRVANY from the Resource Kit, you would think that you could have SRVANY start a batch file, in which you make the modifications and then launch your application. While this does work, it makes it very difficult to administrate the application, since stopping the service mearly stops CMD.EXE, not the application.

Newer versions of SRVANY support a new REG_MULTI_SZ value named AppEnvironment which you add at:

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesParameters

On each line of this Multi_String variable, you add an entry for every environment variable you want the application to see. The syntax is:

temp=c:temporary
PATH=c:AppFolder;c:winNT;C:WinNTSystem32;....App_Switch=123
. . .

Don't forget to add a new line as the last entry.

With the AppEnvironment variable present, no standard environment variables will be usable for this service, unless they are specified in the Multi_String editor.


Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like