loading a symbol into microsoft xp registry by remote logon server

From: cwnewbe1_at_yahoo.com (CWNEWBE1_at_YAHOO.COM)
Date: 02/20/04


Date: 20 Feb 2004 07:06:51 -0800

I would like to be able to add environment symbols to the Microsoft XP
registry. I tried the example in the Python Cookbook by Orielly by
running the script locally and it worked fine. Although I noticed
that even though the symbol showed immediatedly in the registry by
viewing with regedit but not via a new dos command console, thus, I am
forced to reboot to make it 'lock in'. Is this normal?

My wish is to have the script invoked in the start-up script when a
person logs into a network, that, will populate the logging on
machines registry with the desired symbols. The Python.exe is on
another server (not the password verification server).

I do not want to place python.exe on every machine that needs symbols
loaded.

The symbols do not get loaded when I login to the network server.

The network machine is a Windows NT server.

First, in the logon script located on the network server I map a drive
to the server containing the python.exe
      NET USE z: \\heimdall\

Then I next execute in the logon script the python script as:
       z:\python_2.3.2\python.exe z:\QA\env.py

Do I need to use a drive letter mapping, or can I use a URL syntax in
NT?

Enclosed is the code I am executing in env.py, minus the imports:
What am I missing?
Can this be done?
Do I have correct priviledges in the logon script at this time?

# ***************************************************
# Set a System Environment Symbol on a local machine
# c : a computers name \\theComputer
# k : the symbol key
# v : data payload of the symbol value
def setSystemRegistrySymbol(c,k,v):
    print "Setting symbol on machine: " + c + " with symbol : " + k +
"=" + v
    x = _winreg.ConnectRegistry(c,_winreg.HKEY_LOCAL_MACHINE)
    y = _winreg.OpenKey(x,
                        r"SYSTEM\CurrentCOntrolSet\Control\Session
Manager\Environment",
                        0,
                        _winreg.KEY_ALL_ACCESS)
    _winreg.SetValueEx(y,k,0,_winreg.REG_EXPAND_SZ,v)
          
    _winreg.CloseKey(x)
    _winreg.CloseKey(y)

machine = r'\\myMachinesName'

setSystemRegistrySymbol(machine,"QA_BUILD",'\\\\Heimdall\\Firmware\\QA\\')



Relevant Pages

  • Re: Modify Registry on all SBS2003 clients
    ... I would do it with a simple script.. ... copy reg.exe and the registrykey.reg file to a share on the server ... Next time the user logs on, the registry on their computer will be fixed. ... clients. ...
    (microsoft.public.windows.server.sbs)
  • RE: Problem connecting after 2003 client upgrade
    ... you have to clean the registry ... I am sorry i dont have a web link for the script and i didnt do it manualy ... The first thing I did was upgrade my client to 2003. ... I was able to connect to the server ...
    (microsoft.public.project.pro_and_server)
  • Re: [PHP] Reading registry values
    ... command to execute a VB script, which has all the registry access I need. ... this isn't my home server). ...
    (php.general)
  • Re: "called name not present", net use redirection?
    ... to the server via it's NetBIOS name - call the list NetBIOS Required. ... previous steps conditions and put them on a second list called DNS Sufficient. ... all programs that store the servers NetBIOS name in the registry or any file ... of each so I can see their format I'll write you the script you need. ...
    (microsoft.public.win2000.general)
  • Re: Same Internal Server Error from last two days
    ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
    (perl.beginners)