Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've run into an issue with one of my systems where multiple Oracle versions are installed for the support of various applications, but I need to run a program as a Windows service using the Local System account. Currently, I am getting the following error:

System.Exception: OCIEnvNlsCreate failed with return code -1 but error message text was not available.

but I have been informed that this is likely due to the environment variables for the Local System account being set incorrect. As such, how do I go about actually changing the values for the Local System account?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

If you don't mind it being set system-wide, just set it in the System section of the "Environment Variables" dialog in the from the "Advanced" page of the "My Computer" properties. That will definitely set it for the SYSTEM context. You could always over-ride it on a per-user basis, too.

If you really want to set it on the SYSTEM context only, add it to:


If you want to use the Explorer UI to do that, start a command-prompt as SYSTEM using the "at (time now + 1 minute) /INTERACTIVE CMD" trick from the console session, kill the Explorer process running as your user account, and start Explorer from the SYSTEM command prompt. (This is getting into really "unsupported" territory, and I don't necessarily encourage that you do it...)

I'd just set the system-wide environment variable.

share|improve this answer

I would alternatively look at creating a dedicated service account, grant it the rights it needs, configure the service to run under those credentials, and set the ORACLE_HOME variable for that account's profile. You'll find it's easier to audit what your program is doing that way too.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.