Get SystemDrive variable

J

JY Doyon

I'm writing a script that copies all information from the "Documents and
Settings" folder for backup purposes. My problem is that some machines have
the OS installed on a different drive than C:\. Is there any way to get the
environment variable "SystemDrive" with python?

Thanks for the help
 
J

JY Doyon

Found it.

srcdrv = os.getenv("SystemDrive"). I forgot to put the quotes at first.

Thanks
 
?

=?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?=

Not only that, but different versions of Windows have it in a different
place. Sometimes it's in c:\windows\mydocuments or something. You better
get the folder path for Documents and Settings from the registry rather
than starting from C:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,173
Latest member
GeraldReund
Top