By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,627 Members | 1,211 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,627 IT Pros & Developers. It's quick & easy.

windows directory

P: n/a
I would like to write a program which creates the folders in specific
directory.
For example, I want to create folder in Program Files. How do I know which
is in C:\ or D:\
Is there any function to get the active path?

Thanks in advance.
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On XP at least you have the environment variable "ProgramFiles".

You can fetch the path it holds through os.environ

Jul 19 '05 #2

P: n/a
On Tue, 14 Jun 2005 15:32:02 +0800, "Austin" <au****@maxtronic.com.tw>
declaimed the following in comp.lang.python:
I would like to write a program which creates the folders in specific
directory.
For example, I want to create folder in Program Files. How do I know which
is in C:\ or D:\
I'm going to presume this is just an example -- under WinXP,
"Program Files" is a protected directory, only Admin accounts can modify
it.

Scan the registry for, I believe, "shell folders" -- these
entries identify things like a user's desktop folder, etc.

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.