473,562 Members | 3,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

loading a symbol into microsoft xp registry by remote logon server

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

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

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 setSystemRegist rySymbol(c,k,v) :
print "Setting symbol on machine: " + c + " with symbol : " + k +
"=" + v
x = _winreg.Connect Registry(c,_win reg.HKEY_LOCAL_ MACHINE)
y = _winreg.OpenKey (x,
r"SYSTEM\Curren tCOntrolSet\Con trol\Session
Manager\Environ ment",
_winreg.KEY_ALL _ACCESS)
_winreg.SetValu eEx(y,k,0,_winr eg.REG_EXPAND_S Z,v)

_winreg.CloseKe y(x)
_winreg.CloseKe y(y)

machine = r'\\myMachinesN ame'

setSystemRegist rySymbol(machin e,"QA_BUILD",'\ \\\Heimdall\\Fi rmware\\QA\\')
Jul 18 '05 #1
1 2129
On 20 Feb 2004 07:06:51 -0800, CW******@YAHOO. COM (cw******@yahoo .com)
declaimed the following in comp.lang.pytho n:
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?
Reboot might be too severe... Depends... If you added to the
"user" environment variables, simply logging off and on will activate
them (and strangely, since you can program the log-off in Python, easier
than using "my computer/properties/advanced/environment variables" -- it
seems displaying that window, and okaying out, will activate them...).
-- =============== =============== =============== =============== == <
wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
=============== =============== =============== =============== == <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.ne tcom.com/> <

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: lauren quantrell | last post by:
I have an Access application with the name: MyAppName® It has the "®" symbol (ChrW$(&H00AE)) at the end of it. If I remane the application without the "®" symbol, I can use FindWindow to close the application, but with the "®" symbol it doesn't. Unfortunaetley this app is already distributed as MyAppName® and I cannot change it. I have...
by: Kevin Swanson | last post by:
I'm attempting some remote registry manipulation via C#. I've written a test app to simply grab a specified key from a specified hive on a specified machine. The call to OpenSubKey is throwing System.SecurityException. Also of note: Sitting at my local box, I can open regedit and connect to the remote registry. I see three hives:...
by: Ulf | last post by:
Hi all, I run into some problems when trying to copy a file to a remote machine. I first create with WMI a share on the remote machine (works fine), then impersonate with admin rights and try to copy the file using the File.Copy method. But the exception always returns a "(local)file not found" message. Could someone give me a hint where I...
by: Karl Lang | last post by:
Hi I'm trying to edit pages from inside Visual Studio 2002 on a remote server Windows 2000 using FrontPage extensions. Its been working fine for quite a few weeks but since a problem with the power supplier to the machine which caused it crash I've been getting a strange problem. I can be editing pages and saving them back to the server...
by: rfontaine | last post by:
I have a virtual directory on IIS 5.0 to a remote share on a Windows 2003 file server. The "connect as" is a domain user account. The share as read permission for everyone and the NTFS permission is set so the user as access to the directory. I get the stop sign with the status "logon failure: the user has not been granted the request type...
by: RvGrah | last post by:
After much hair-pulling, I've finally found the answer to a problem that many are fighting with, difficulty connecting from Sql 2005 Server Management or VS2005 to a remote Sql Server running Sql 2000. In my case the server I couldn't reach was across a vpn connection, behind ISA server 2000, (which had port 1433 open). The answer was in...
by: Olav | last post by:
Hi all, I can not install CF 2.0 SP 1 on an Symbol PPT8800 running WinCE 4.2. The Install-Log say's cgacutil.exe failed with exit-code 80000004 and I get a messagebox indicating a support-Info '3'. This would mean I would not have enough space on my device. But I hard-reseted it befor I tryed to install and I have no other processes...
by: UK1967 | last post by:
I wrote a ASP.NET application (Windows 2003 Enterprise Server, IIS, .NET Framework 1.1). This application use the Windows (AD) account and impersonation. Some functions in this application contact, read and change the remote registry (HKLM/Software/...) of some internal server. After installing SP1 on the web server (IIS) all functions with...
by: =?Utf-8?B?QWRyaWFuTW9ycmlz?= | last post by:
Hello! I'm trying to copy a file from another computer on the network that I do not have permission with my current logon details to access. If I open the folder using the Windows file manager with the path "\\\temp" (where temp is a shared directory on server \\, windows prompts for a User Name and password of a...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.