Code: Select all
PS C:\xx> attrib * +p
PS C:\xx> attrib *
A P C:\xx\junk.zip
Code: Select all
PS C:\xx> attrib *
A C:\xx\junk.zip
Moderators: Hacker, petermad, Stefan2, white
Code: Select all
PS C:\xx> attrib * +p
PS C:\xx> attrib *
A P C:\xx\junk.zip
Code: Select all
PS C:\xx> attrib *
A C:\xx\junk.zip
It is an attribute used mainly in OneDrive. A pinned file or folder is always available locally.But what is the purpose of this attribute? I've never heard about it.
Assuming you mean the File Explorer tool, I wouldn't even bother with that, given Raymond Chen's May-18 post:Windows 10 internal zip
Code: Select all
PS C:\xx> compress-archive -path 1 -update -DestinationPath ca1.zip # create an archive CA1.ZIP
PS C:\xx> attrib * # show the attributes
A P C:\xx\1
A P C:\xx\2
A C:\xx\ca1.zip
PS C:\xx> attrib ca1.zip +p # set PINNED file attribute for CA1.ZIP
PS C:\xx> attrib *
A P C:\xx\1
A P C:\xx\2
A P C:\xx\ca1.zip
PS C:\xx> compress-archive -path 2 -update -DestinationPath ca1.zip # add a file to CA1.ZIP
PS C:\xx> attrib * # Yay! CA1.ZIP still had the PINNED file attribute
A P C:\xx\1
A P C:\xx\2
A P C:\xx\ca1.zip
Code: Select all
PS C:\xx> .\7za.exe l -slt ca1.zip # Use 7za to display the attributes inside the archive.
7-Zip (a) 19.00 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
Listing archive: ca1.zip
Attributes =
Code: Select all
PS C:\xx> .\7za.exe a arc.7z 1
7-Zip (a) 19.00 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
Scanning the drive:
1 file, 13 bytes (1 KiB)
Creating archive: arc.7z
Creating archive: arc.7z
Add new data to archive: 1 file, 13 bytes (1 KiB)
Files read from disk: 1
Archive size: 123 bytes (1 KiB)
Everything is Ok
PS C:\xx> .\7za.exe l -slt arc.7z # Note output is edited, but PINNED file attribute is inside the archive
Listing archive: arc.7z
Path = 1
Size = 13
Modified = 2020-02-15 15:58:02
Attributes = AP
CRC = DB5BCF1B
Encrypted = -
Method = LZMA2:12
Block = 0
PS C:\xx> attrib *
A P C:\xx\1
A P C:\xx\2
A P C:\xx\3
A P C:\xx\7za.exe
A C:\xx\arc.7z
PS C:\xx> attrib arc.7z +p
PS C:\xx> attrib *
A P C:\xx\1
A P C:\xx\2
A P C:\xx\3
A P C:\xx\7za.exe
A P C:\xx\arc.7z
PS C:\xx> .\7za.exe a arc.7z 2 # update the arc.7z archive with file '2' (output is edited)
7-Zip (a) 19.00 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
Open archive: arc.7z
Updating archive: arc.7z
Keep old data in archive: 1 file, 13 bytes (1 KiB)
Add new data to archive: 1 file, 13 bytes (1 KiB)
Files read from disk: 1
Archive size: 173 bytes (1 KiB)
Everything is Ok
PS C:\xx> attrib * # Whoops, the archive file arc.7z lost the PINNED attribute!
A P C:\xx\1
A P C:\xx\2
A P C:\xx\3
A P C:\xx\7za.exe
A C:\xx\arc.7z