473,587 Members | 2,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

windows directory

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
2 1197
On XP at least you have the environment variable "ProgramFil es".

You can fetch the path it holds through os.environ

Jul 19 '05 #2
On Tue, 14 Jun 2005 15:32:02 +0800, "Austin" <au****@maxtron ic.com.tw>
declaimed the following in comp.lang.pytho n:
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.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
=============== =============== =============== =============== == <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.ne tcom.com/> <

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
6741
by: | last post by:
Hi, I have a Windows Service that uses a referenced dotnet-dll. In my dll I set some public string to a stringvalue that I get from reading a xml-file(my config file). It works fine if I use it in a vb-form. But since Windows Services ? executes? in windows\system32 I can´t locate my xml-config- file. I don´t want to set different...
2
2615
by: Joseph Geretz | last post by:
I'm having a credentialing problem in my web application. Actually, I don't think this is an IIS security issue, since I'm able to access the page I'm requesting. However, the executing page itself is not able to access a specific network resource and I just can't figure out why. First of all, let me say this worked fine with IIS running on...
10
4044
by: Hriday | last post by:
Hi there, Please help me..It is urgent This is Hriday, working on windows authentication with Active Directory... My requirment is when a user sends a request to my web Applicatoin I want to Pop up windows Authentication box so that user will give his userId, Password & domain name for authenticaion. After that I want to take these...
3
7477
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work on her local machine. Everything looks pretty good. OpenLDAP/cygwin works great. PostgreSQL works great. Apache runs. PHP runs. But when I...
17
5080
by: Jon B | last post by:
Hi All! I have a ASP.NET 2.0 site that works on the Windows 2000 Server. However, when I tried to view this site on my local Windows XP machine, I get "Server Unavailable". If I switch the Windows XP IIS back to ASP.NET 1.1 then I get the Configuration Error (which is understandable because I'm trying to run an ASP.NET 2 site with 1.1...
12
5721
by: pac | last post by:
I'm preparing to distribute a Windows XP Python program and some ancillary files, and I wanted to put everything in a .ZIP archive. It proved to be inordinately difficult and I thought I would post my solution here. Is there a better one? Suppose you have a set of files in a directory c:\a\b and some additional files in c:\a\b\subdir....
17
15564
by: ~john | last post by:
As the installation txt suggests, I have left my php.ini file inside the c:\php directory... but running phpinfo() shows that my php.ini file is in c:\windows as shown below. Configuration File (php.ini path) - C:\WINDOWS Well there is no php.ini file in my windows directory, so I'm not sure where it's getting it's configuration settings...
12
2328
by: comp.lang.php | last post by:
Env: Windows XP, Apache 1.33, PHP 5.2.0 <? echo is_dir($_SERVER) . " for dir = " . $_SERVER); ?>
1
3827
RRick
by: RRick | last post by:
I have a unix C++ project that needs to be converted over to windows visual studio. I'm not sure of the exact version of VS, but it's a recent version, probabIy 2003 or 2005. I would like the windows directory tree to mimic the unix tree as closely as possible, but I don't want duplicate files and other inconsistencies. I have come up with...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8205
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.