When setting variables using the 'set' command, they are only valid for that command interpreter session. In other words, assigning variables in the login script (batch, cmd file) using the standard 'set' command doesn't work. They only exist in memory until the login script finishes (exits the command interpreter).
If you want the variables to be permanent, available in the shell or command interpreter session after the login script, you need to use a separate command. I've used the setx.exe utility from the resource kit in the past to assign user and machine(system) variables via the login script. There are probably other utils out there as well. Setx.exe is from the Resource kit(both NT4 and W2K). Here's a link to it: (remove spaces in URL, if any appear)
http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/setx-o.asp
System variables are available to any user or process logged into the machine. User variables are only available when that particular user is logged on.
One other note: User and System variables are written to the registry. If you have any registry editing tools or programming experience you can edit either one of the following reg-keys to add, delete, modify variables:
user variables:
HKCU\Environment
system variables:
HKLM\System\CurrentControlSet\Control\Session Manager\Environment
I believe these reg paths are true for both NT and W2K.
Good luck!