hidden attribute on Windows files

"Martin v. Löwis" martin at v.loewis.de
Mon Mar 7 16:05:22 EST 2005


rbt wrote:
> How do I enable the hidden attribute when creating files on Windows 
> computers? I'd *really* prefer to do from the standard Python installer 
> (no win32 extensions). Any tips?

With pure Python and just the standard installer, you need to invoke
attrib.exe, as

attrib.exe +H <pathname>

Use os.system to invoke that command, make sure you get the quoting
right in case pathname might contain spaces. attrib.exe is located
in the system folder (windows\system32), so it should be on the PATH.

HTH,
Martin



More information about the Python-list mailing list