473,241 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

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 2364
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
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.