[python-win32] E_ACCESSDENIED problem with disk quota.

Y.H. Rhiu master at hilug.org
Fri Oct 24 04:55:07 EDT 2003


Sorry, I repost this mail because of email MIME-encoding problem.
--------------------------------------------------------------------

Hi,

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

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

import win32com.client

qutoa=win32com.client.Dispatch('Microsoft.DiskQuota.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


More information about the Python-win32 mailing list