[Last Call] Learn how to a build a cloud-first strategyRegister Now


Environment Variable from Novell

Posted on 2013-02-04
Medium Priority
Last Modified: 2013-02-06
Hi Experts!

I have a tough one I've been pulling my hair out over for the past few days. So a little background, we have some Novell 6.5 servers that we have been slowly migrating away from for the past year. We're nearing the end of the migration and we ran into an odd problem. When we turned off the Novell login script printing from our internal ERP program stopped functioning. This program was built in house, and was originally designed for Novell but over the years has been migrated to a Windows platform. Everything has been moved to Windows and has been functioning fine for weeks until we disabled the script. We played with the script and were able to isolate the problem to a single line that is responsible:
SET OS      = "%OS"
Somehow printing is using this variable to execute the print command. The problem is this program is very old and difficult to troubleshoot and even worse to repair so we've been trying to replicate this command in windows but here is where the question comes in. Novell only seems to set this variable on a per session basis and if you don't use the Novell login script the variable defaults back to the original. (Original in Win7 is Windows_NT, after Novell script is WINNT) It's not changing the OS variable under Environmental variables or in any registry keys I can find so first question is where is this change being made? Second, is there a way to set an environmental variable for just a single session and not machine wide? We've found that if you use the SET command in a command prompt we can get the same result but it's only within that command prompt session, once you close the window and launch a new one the variable is gone. And we've played with SETX but you're only able to set user variables with that commad, not system variables.

Any help or insight you guys can provide would be appreciated!
Here are some extra details to help avoid some of the generic questions:
1) Workstations are Windows 7 Pro with all current updates
2) Novell server are Novell 6.5
3) Windows domain is all server 2003
Question by:Aero_Admin
  • 2
  • 2
LVL 19

Accepted Solution

deroode earned 1500 total points
ID: 38854060
The Novell login script runs before explorer.exe runs, and the environment variables it sets are not stored. In the same manner I would presume that setting an environment variable in the startup script would be similar, but i currently cannot test.

Furthermore: if %OS% is WINNT for the whole duration of a windows session, what is the disadvantage of setting the OS variable in the registry to WINNT?

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

Author Comment

ID: 38855471
Thanks for the reply! That's the direction we've been heading in our testing but my only concern is would changing the machine OS variable via that registry key have any other adverse effects on the machine? Ie...problems with software installs, wrong OS being seen by various programs etc.

We have found in our testing that changing that key does correct the problem but like I said, I'm weary of changing it just due to unforseen consequences. Does anybody know if changing it would cause any problems?
LVL 19

Expert Comment

ID: 38858970
The environment variable OS has been Windows_NT since windows NT; i cannot imagine any program using that variable to determine the os version;
Besides, when you change the environment variable "OS" systemwide from a startup or login script that will basically have the same impact as changing it through the registry.
Could you try to test setting the OS variable through the startup script?

Author Closing Comment

ID: 38859889
We went along the same lines as your solution. We found that we could create a user variable for the OS that was being read over the system variable. This way the system variable stays intact and unchanged while the user variable gives us the result we needed. Thanks for your help!!

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question