Hello,
I have a script which updates a bunch of windows machines with some new software. If the software has never been installed on those machines before, I need to add the path to that software into the windows path environment variable permanently.
here's what I do.
newpath = 'c:\\newapp'
path = os.environ['path']
path_array = path.split(';')
pathfound = 'false'
for p in path_array:
if p == newpath:
pathfound = 'true'
break
if pathfound == 'false':
os.environ[path] += ';' + newpath
print os.environ['path']
the last statement shows the new path was added to the path environment variable, however, when I right click on my computer, choose properties, environment, the new path did not get appended.
am I doing something wrong or is that just not possible
thanks
yann
I have a script which updates a bunch of windows machines with some new software. If the software has never been installed on those machines before, I need to add the path to that software into the windows path environment variable permanently.
here's what I do.
newpath = 'c:\\newapp'
path = os.environ['path']
path_array = path.split(';')
pathfound = 'false'
for p in path_array:
if p == newpath:
pathfound = 'true'
break
if pathfound == 'false':
os.environ[path] += ';' + newpath
print os.environ['path']
the last statement shows the new path was added to the path environment variable, however, when I right click on my computer, choose properties, environment, the new path did not get appended.
am I doing something wrong or is that just not possible
thanks
yann