Tim & Paul,

> 
> Message: 3
> Date: Thu, 24 Jan 2008 14:31:07 -0500
> From: Paul Koning <[EMAIL PROTECTED]>
> Subject: Re: [python-win32] Changing a drive letter
> To: [EMAIL PROTECTED]
> Cc: python-win32@python.org
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=us-ascii
> 
> >>>>> "Tim" == Tim Roberts <[EMAIL PROTECTED]> writes:
> 
>  >> ...And here's the diskpart line:
>  >> 
>  >> subprocess.call(r'diskpart /s \\%s\someFolder\change_g.txt' %
>  >> pdcName)
> 
>  Tim> In my own personal opinion, there's absolutely nothing wrong
>  Tim> with this.  That's what the tool is there for, after all.  Yes,
>  Tim> it would probably be possible for you to dig up the disk manager
>  Tim> APIs you need to do the same thing programmatically, but because
>  Tim> their use is obscure, they probably aren't going to be exposed
>  Tim> in the standard PyWin32 modules, and then you have the added
>  Tim> burden of error handling.
> 
> I agree.  If you do want to use an API rather than a subprocess, WMI
> might serve.  The biggest drawback of WMI is that the documentation is
> partly nonexistent and, when it does exist, is of very low quality.
> 
> On the other hand, the Python WMI module is quite nice.
> 
>    paul
> 

Well, that's good to know. I would like it to map the USB device to the
next available drive letter and while the docs for diskpart claim that
changing the assign command to the following works:

assign letter

I can't get my test script to work. Oh well...I'll just keep doing what
I'm doing and hope that it doesn't clobber some other device. Thanks for
the affirmations, guys.

Mike


_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to