Re: extending PATH on Windows?

2016-02-20 Thread eryk sun
On Fri, Feb 19, 2016 at 6:57 PM, Dennis Lee Bieber wrote: > > Problem -- if the OP's PATH had contained the location of the add2path > script, the OP might not have needed to search for it... (presuming their > configuration also was set up to treat .py files as

Re: extending PATH on Windows?

2016-02-19 Thread eryk sun
On Fri, Feb 19, 2016 at 8:18 AM, Gisle Vanem wrote: > Dennis Lee Bieber wrote: > How can one search for files with DOS? >>> >>> dir /s /b \*add2path.* >>> >>> ChrisA >> >> Or move to PowerShell... >> >> Windows PowerShell >> Copyright (C) 2009 Microsoft Corporation.

Re: extending PATH on Windows?

2016-02-19 Thread eryk sun
On Thu, Feb 18, 2016 at 10:55 AM, Ulli Horlacher wrote: > Ulli Horlacher wrote: > >> > but simpler still and more reliable to just call QueryValueEx. >> >> I find it more complicated. > > I have now (after long studying docs and

Re: extending PATH on Windows?

2016-02-19 Thread eryk sun
On Fri, Feb 19, 2016 at 4:48 AM, Chris Angelico wrote: > On Fri, Feb 19, 2016 at 9:42 PM, Ulli Horlacher > wrote: >> pyotr filipivich wrote: >> >>> > Windows (especially 7) search function is highly crippled. There is

Re: extending PATH on Windows?

2016-02-19 Thread pyotr filipivich
Ulli Horlacher on Fri, 19 Feb 2016 10:42:52 + (UTC) typed in comp.lang.python the following: >pyotr filipivich wrote: > >> > Windows (especially 7) search function is highly crippled. There is >> >some command sequence that will

Re: extending PATH on Windows?

2016-02-19 Thread Gisle Vanem
Dennis Lee Bieber wrote: >>> How can one search for files with DOS? >> >> dir /s /b \*add2path.* >> >> ChrisA > > Or move to PowerShell... > > Windows PowerShell > Copyright (C) 2009 Microsoft Corporation. All rights reserved. > > PS C:\Users\Wulfraed\Documents> Get-ChildItem -Path c:\

Re: extending PATH on Windows?

2016-02-19 Thread Chris Angelico
On Fri, Feb 19, 2016 at 9:42 PM, Ulli Horlacher wrote: > pyotr filipivich wrote: > >> > Windows (especially 7) search function is highly crippled. There is >> >some command sequence that will open it up to looking at other file types >>

Re: extending PATH on Windows?

2016-02-19 Thread Ulli Horlacher
pyotr filipivich wrote: > > Windows (especially 7) search function is highly crippled. There is > >some command sequence that will open it up to looking at other file types > >and locations. > > >

Re: extending PATH on Windows?

2016-02-18 Thread pyotr filipivich
Dennis Lee Bieber on Thu, 18 Feb 2016 21:57:13 -0500 typed in comp.lang.python the following: >On Thu, 18 Feb 2016 16:24:00 + (UTC), Ulli Horlacher > declaimed the following: > >>Dennis Lee Bieber wrote: >> >>> >I

Re: extending PATH on Windows?

2016-02-18 Thread Ulli Horlacher
Ulli Horlacher wrote: > > but simpler still and more reliable to just call QueryValueEx. > > I find it more complicated. I have now (after long studying docs and examples):: def get_winreg(key,subkey): try: rkey =

Re: extending PATH on Windows?

2016-02-18 Thread Ulli Horlacher
eryk sun wrote: > https://hg.python.org/cpython/file/v2.7.11/Tools/scripts/win_add2path.py > > But there are a few issues with this script. (... lot of flaws ...) > Here's a new version for Python 2. I generalized the shell-variable > replacement to a list of well-known

Re: extending PATH on Windows?

2016-02-18 Thread Ulli Horlacher
Dennis Lee Bieber wrote: > >I have > >"Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC > >v.1500 32 bit (Intel)] on win32" > >and there is no "win_add2path.py" > > > C:\Python_x64\Python27\Tools\scripts\win_add2path.py Ok, It is here in

Re: extending PATH on Windows?

2016-02-18 Thread eryk sun
On Wed, Feb 17, 2016 at 6:53 PM, Dennis Lee Bieber wrote: > On Wed, 17 Feb 2016 17:49:11 + (UTC), Ulli Horlacher > declaimed the following: > >>Thorsten Kampe wrote: >> >>> By the way: there is a script called

Re: extending PATH on Windows?

2016-02-17 Thread Ulli Horlacher
eryk sun wrote: > >> The AutoRun command (it's a command line, not a script path) > > > > A script path is a legal command line, too. > > If the registry value were just a script path, you'd have to modify > your script to chain to the previous script, if any. Since it's a >

Re: extending PATH on Windows?

2016-02-17 Thread eryk sun
On Wed, Feb 17, 2016 at 2:29 PM, Ulli Horlacher wrote: > eryk sun wrote: >> > >> > set PATH=%PATH%;%USERPROFILE%\Desktop >> >> The AutoRun command (it's a command line, not a script path) > > A script path is a legal command line, too. If the

Re: extending PATH on Windows?

2016-02-17 Thread Ulli Horlacher
eryk sun wrote: > > At startup cmd.exe runs a script which is defined by the registry variable > > AutoRun in "HKCU\Software\Microsoft\Command Processor" > > > > I set this variable with: > > > > rc = "HKCU\Software\Microsoft\Command Processor" > > ar =

Re: extending PATH on Windows?

2016-02-17 Thread eryk sun
On Wed, Feb 17, 2016 at 11:49 AM, Ulli Horlacher wrote: > At startup cmd.exe runs a script which is defined by the registry variable > AutoRun in "HKCU\Software\Microsoft\Command Processor" > > I set this variable with: > > rc = "HKCU\Software\Microsoft\Command

Re: extending PATH on Windows?

2016-02-17 Thread Ulli Horlacher
Thorsten Kampe wrote: > By the way: there is a script called `win_add2path.py` in your Python > distribution I have "Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32" and there is no "win_add2path.py" But I found

Re: extending PATH on Windows?

2016-02-16 Thread Thorsten Kampe
* Ulli Horlacher (Tue, 16 Feb 2016 12:38:44 + (UTC)) By the way: there is a script called `win_add2path.py` in your Python distribution which "is a simple script to add Python to the Windows search path. It modifies the current user (HKCU) tree of the registry.". That should do most of

Re: extending PATH on Windows?

2016-02-16 Thread Thorsten Kampe
* Ulli Horlacher (Tue, 16 Feb 2016 12:38:44 + (UTC)) > > Thorsten Kampe wrote: > > * Ulli Horlacher (Tue, 16 Feb 2016 08:30:59 + (UTC)) > > > I need to extend the PATH environment variable on Windows. > > > > 1. Add the path component yourself into

Re: extending PATH on Windows?

2016-02-16 Thread eryk sun
On Tue, Feb 16, 2016 at 2:30 AM, Ulli Horlacher wrote: > > So far, I use: > >system('setx PATH "%PATH%;'+bindir+'"') > > The problem: In a new process (cmd.exe) PATH contains a lot of double > elements. As far as I have understood, Windows builds the PATH >

Re: extending PATH on Windows?

2016-02-16 Thread Ulli Horlacher
Thorsten Kampe wrote: > * Ulli Horlacher (Tue, 16 Feb 2016 08:30:59 + (UTC)) > > I need to extend the PATH environment variable on Windows. > > 1. Add the path component yourself into HKEY_CURRENT_USER and make > sure it's not there already (pure Python).

Re: extending PATH on Windows?

2016-02-16 Thread Thorsten Kampe
* Ulli Horlacher (Tue, 16 Feb 2016 08:30:59 + (UTC)) > I need to extend the PATH environment variable on Windows. > > So far, I use: > >system('setx PATH "%PATH%;'+bindir+'"') > > The problem: In a new process (cmd.exe) PATH contains a lot of double > elements. As far as I have

extending PATH on Windows?

2016-02-16 Thread Ulli Horlacher
I need to extend the PATH environment variable on Windows. So far, I use: system('setx PATH "%PATH%;'+bindir+'"') The problem: In a new process (cmd.exe) PATH contains a lot of double elements. As far as I have understood, Windows builds the PATH environment variable from a system component