Environment Variable from Novell

Posted on 2013-02-04
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 500 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
robocopy 33 117
see android hidden files 10 102
How do I make a bootable windows flash drive? 11 62
Can't install Windows 7 on Intel NUC 9 53
Article by: Lee
Windows 7 Ultimate and Enterprise (and 2008 R2) introduced a new feature you may not be aware of - Boot from VHD.   Boot from VHD (or what Microsoft refers to asNative Boot allows you to install Windows to a VHD (Virtual Hard Disk) file that is t…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.

831 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