473,473 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

E_ACCESSDENIED problem with win32 disk quota

Hi,

I'm testing to control Windows disk quota by PythonWin on win2003 and
winXP.

But ther is some problem..
This is the test code:

import win32com.client

qutoa=win32com.client.Dispatch('Microsoft.DiskQuot a.1')
quota.Initialize('c:\\',1)
test=quota.AddUser('test') ## 'test' is real account name in my
machine.
test.QuotaLimit=10000000 # 10MB

However, If I run it within PythonWin, I get this returned error
message:
t.QuotaLimit=10000000

Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "C:\Python22\Lib\site-packages\win32com\client\__init__.py",
line 355, in __setattr__
apply(self._oleobj_.Invoke, args + (value,) + defArgs)
com_error: (-2147352567, 'Exception occurred.', (0, None, None, None,
0, -2147024891), None)

I have known error code -2147024891 (0x80070005) means E_ACCESSDENIED
by someone's kind help. (Thanks Roger :)

But I run PythonWin on Administrator privilege and I couldn't find any
related method for setting permission in 'Microsoft.DiskQuota.1'
object.

Does anyone have any ideas?

Thanks!

--
Y.H. Rhiu
Jul 18 '05 #1
1 2373
Bart Simpson wrote:

I have known error code -2147024891 (0x80070005) means E_ACCESSDENIED
by someone's kind help. (Thanks Roger :)

But I run PythonWin on Administrator privilege and I couldn't find any
related method for setting permission in 'Microsoft.DiskQuota.1'
object.

Does anyone have any ideas?


I think this will probably similar to rebooting the PC: You will need to
acquire some kind of "Security Token".

Unfortunately I don't have the actual name for it handy :-(

So even when you have the right to do it, you need to tell windows that
you are about to do something "potentially dangerous".
hth

Werner

Jul 18 '05 #2

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

Similar topics

1
by: Rajesh Kapur | last post by:
Hello, Is there a way to assign a limit on the size of a specific database? For example database A can take up no more than 500 MB. One of my databases can potentially grow without any bounds...
14
by: Aaron Couts | last post by:
I have a program that writes to a log file. It's compiled on RH Linux 7.3 (Kernel 2.4.18-18.7). It's using fopen in append mode. When the file reaches 51200000 bytes in size, the program will no...
2
by: Joe | last post by:
Hi Guys, Is it possible to create a disk management system using .NET entirely. What I mean by the above is having an application possibly a .NET windows service monitoring the disk, creating...
1
by: Oney | last post by:
I use Microsoft Exception management block to publish exception to event log. but some error occured. Error is blow, how can I solve this problem ??? Configuration Error Description: An error...
9
by: freduchi | last post by:
Hi, I need sugestions. I need to implement the next and I don´t know how to do it: I am developing a website in which users are signed up and share information(Messages, Photos...). When a...
0
by: microtom | last post by:
Hi chaps I found that the DiskQuotaTypeLibary (dskquota.dll) offers an easy way to get disk quota information for an NTFS volume. Does anybody know of how to get this information from a unix...
3
by: =?Utf-8?B?bWFkY3lyeWw=?= | last post by:
I am currently in an educational enviroment and have decided to limit student folders to 75mb in size using disk quotas. this has now been implemented but quite a few folders are showing up in disk...
5
by: mostro713 | last post by:
Hello all, I would like to write a script in Python to email me when disk space gets below a certain value. My first question (I'm sure of many) is how do get this output into a dictionary or...
1
by: Greg99 | last post by:
Hello. I need to find the available space for a given path (could be a network path) with a quota applied, but when I use the following code, it gives me the available space on the entire drive. ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.