471,336 Members | 997 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,336 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 2310
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Rajesh Kapur | last post: by
14 posts views Thread by Aaron Couts | last post: by
2 posts views Thread by Joe | last post: by
9 posts views Thread by freduchi | last post: by
3 posts views Thread by =?Utf-8?B?bWFkY3lyeWw=?= | last post: by
5 posts views Thread by mostro713 | last post: by
reply views Thread by rosydwin | last post: by

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.