Hi Tim,
Thanks, this works!
But now the set value part gives access denied.
I checked around, it seems the file needs to be opened in GPS_READWRITE mode
in order to write info to the file.
So I tried:
from win32comext.shell import shellcon
properties = propsys.SHGetPropertyStoreFromParsingName(
        file_name, Flags=shellcon.GPS_READWRITE)
it reported:
SHGetPropertyStoreFromParsingName() takes no keyword arguments

then I tried
    riid = ""
    ctx = None
    properties = propsys.SHGetPropertyStoreFromParsingName(
        file_name, ctx, shellcon.GPS_READWRITE, riid)
it reported:
(-2147221005, 'Invalid Class String', None, None)

sorry for the different issues, possible to take a look on this?

Thanks!

On Fri, Nov 8, 2019 at 5:22 AM Tim Roberts <t...@probo.com> wrote:

> On Nov 7, 2019, at 2:33 PM, Peng Chen <capan...@gmail.com> wrote:
>
>
> I tried:
>     dateShifted = propsys.PyPROPVARIANT(
>         mDate + shift_time.timedelta_obj, pythoncom.VT_DATE)
> and it reports:
> module 'win32comext.propsys.propsys' has no attribute ‘PyPROPVARIANT'
>
>
> It is embarrassing that I had to figure this out twice today.
>     dateShifted = propsys.PROPVARIANTType(mDate+shift_time.timedelta_obj,
> pythoncom.VT_DATE)
>
> The PROPVARIANTType function returns a PyPROPVARIANT object.
> —
> Tim Roberts, t...@probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> python-win32 mailing list
> python-win32@python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to