Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Diez B. Roggisch
b = a.strip(r'\\\x00') b > 'A:\\\x00C:\\\x00D:\\\x00E:\\\x00Z:\\\x00' b = a.split(r'\\\x00') b > ['A:\\\x00C:\\\x00D:\\\x00E:\\\x00Z:\\\x00'] > > I'm a bit of a novice at python (even more so of the win32 api), but > I've used the split and strip functions before (for example t

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Roger Upole
The split should work fine if you remove the r (raw string) prefix. >>> win32api.GetLogicalDriveStrings().split('\\\x00') ['A:', 'C:', 'D:', 'E:', 'F:', 'G:', 'H:', 'J:', 'K:', 'Y:', 'Z:', ''] Roger "Lucas Machado" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Roger Upol

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Lucas Machado
Roger Upole wrote: > You could use win32api.GetLogicalDriveStrings to list > the drive letters currently in use, and find the next free > letter. net use * probably does something like that under > the covers. I went and took your advice and this is where I am now: >>> import win32api >>> a = wi

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Roger Upole
You could use win32api.GetLogicalDriveStrings to list the drive letters currently in use, and find the next free letter. net use * probably does something like that under the covers. hth Roger "Lucas Machado" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Alex Ma

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Lucas Machado
I have already seen the "net help use" and i know how to manage samba shares from a command prompt. What i need help with is using the win32 api for python to manage shares --Lucas -- http://mail.python.org/mailman/listinfo/python-list

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread [EMAIL PROTECTED]
Lucas Machado wrote: > Alex Martelli wrote: > > > import win32net > > win32net.NetUseAdd(None,1,{'remote':r'\\server\share','local':'K:'}) > > > > is an example (not all that easy to fathom from the docs, but I > > found it out with a little help from the docs, a little from MSDN, > > and a little

Re: Win32 drive mapping... aka "net use"

2005-03-05 Thread Lucas Machado
Alex Martelli wrote: > import win32net > win32net.NetUseAdd(None,1,{'remote':r'\\server\share','local':'K:'}) > > is an example (not all that easy to fathom from the docs, but I > found it out with a little help from the docs, a little from MSDN, > and a little experimentation). I looked through