SetAttr
The SetAttr internal command can be used to:
Modify the attributes of files or folders
Compress (by setting the C attribute) or encrypt files (by setting the E attribute), and set the default compression/encryption status for folders
Modify the last modified and creation timestamps of files or folders
Modify file metadata, either through a user-interface or programmatically
Assign your own description to files and folders, and edit the internal comment for a Zip archive
Modify attributes of files on remote FTP sites
Command Arguments:
Argument | Type | Possible values | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
(no argument) | - | - | Displays the Change Attributes & Times dialog, which lets you modify the attributes and timestamps of selected files and folders. Example: | ||||||||||||||||
ATTR | /K | <attributes> | Sets the specified attributes for selected files and folders, and clears all others. The <attributes> value must consist of one or more of the following letters:
Note that modifying the C or E attributes may take longer than normal, as the file data has to be (un)compressed or (un)encrypted. Setting these attributes for folders sets the default compression/encryption state for new files created in those folders. A file can be compressed, or encrypted, but not both at once. Example: | ||||||||||||||||
R | Read-only (files can not be deleted or overwritten) | ||||||||||||||||||
A | Archive (file needs to be archived, used by backup tools) | ||||||||||||||||||
H | Hidden (files can be marked as hidden to hide them from the display) | ||||||||||||||||||
S | System (file is a system file - usually set in conjunction with H) | ||||||||||||||||||
N | Normal (normal attributes, none of the other attributes set) | ||||||||||||||||||
I | Non-content Indexed (contents will not be indexed by the system) | ||||||||||||||||||
C | Compressed (on NTFS-formatted drives only) | ||||||||||||||||||
E | Encrypted (on NTFS-formatted drives only) | ||||||||||||||||||
CHMOD | /K | <attribute mask> | Sets the specified attributes for files on a remote FTP site. The <attribute mask> is specified using octal notation. Example: | ||||||||||||||||
CLEARATTR | /K | <attributes> | Clears the specified attributes for selected files and folders. The specified attributes will be turned off, but other attributes will be untouched. See the description of the ATTR argument for a list of attribute values. Example: | ||||||||||||||||
CREATED | /K | <date/time> | Sets the creation timestamp for selected files and folders. The value for this argument can be given as either a date only, a time only, or a date and time. The accepted formats for the date string are YYYYMMDD or YYYY-MM-DD, and the time string must be in the format HH:MM:SS. If you specify a time as well as a date the time must come after the date, separated by a space, and you must enclose the entire value in quotes (because of the embedded space). If only a time is provided, the file's current date will be preserved (and vice versa). Example: | ||||||||||||||||
now | Sets the creation timestamp to the current date and time. Example: | ||||||||||||||||||
modified | Copies the last modified timestamp of the file. Example: | ||||||||||||||||||
taken | For image files, copies the Date Taken timestamp. If the file doesn't have an EXIF tag the creation timestamp won't be changed. Example: | ||||||||||||||||||
digitized | For image files, copies the Date Digitized timestamp. If the file doesn't have an EXIF tag the creation timestamp won't be changed. Example: | ||||||||||||||||||
parent | Copies the creation timestamp from the parent folder. Example: | ||||||||||||||||||
doccreated | For document files, copies the Document Created timestamp. If the file doesn't have this timestamp in its metadata the creation timestamp won't be changed. Example: | ||||||||||||||||||
docedited | For document files, copies the //Document Last Edited //timestamp. If the file doesn't have this timestamp in its metadata the creation timestamp won't be changed. Example: | ||||||||||||||||||
docsaved | For document files, copies the Document Last Saved timestamp. If the file doesn't have this timestamp in its metadata the creation timestamp won't be changed. Example: | ||||||||||||||||||
DEHYDRATE | /S | (no value) | For cloud files on Windows 10 and above, this command "dehydrates" the file (removes local data and replaces it with a placeholder). This is equivalent to the "Free up space" context menu command that OneDrive adds. Example: | ||||||||||||||||
DESCRIPTION | /O | (no value) | Displays the Set Description dialog, which lets you assign your own description string to selected files and folders. Example: | ||||||||||||||||
<description> | Sets the description for selected files and folders to the specified string. Example: Note that an empty string will be treated the same as not passing a string at all, causing the Set Description dialog to open. If you want an empty string to clear the description, use the SETDESCRIPTION argument instead. | ||||||||||||||||||
FILE | /M | <filename>, ... | Specifies the name of the file or files to modify. If you don't provide this argument the command operates on all selected items in the source Lister. This is the default argument for the SetAttr command - you don't need to specify the FILE keyword. If you only specify the filename instead of the full path of the file or files, Opus will look in the current source folder. You can also specify a wildcard pattern. Remember that if the filename contains spaces you need to enclose it in quotes. Example: | ||||||||||||||||
FILTER | /K | <filter> | Applies the specified filter to the contents of selected folders. This must have previously been created from the Filters page in Preferences. You can also directly specify a simple wildcard pattern Example: | ||||||||||||||||
FILTERDEF | /K/R | <filter> | Lets you define a filter in text format to filter the contents of selected folders. This is similar to the FILTER argument, however the filter does not need to be predefined. This is a /R argument and so everything after the FILTERDEF keyword will be treated as the argument's value. Example: | ||||||||||||||||
META | /O/M | (no value) | Displays the Set Metadata dialog, which lets you modify the metadata for selected files and folders. Example: | ||||||||||||||||
keyword:<value>, ... | Sets the specified metadata fields to the supplied values. Changes are made (where applicable) to all selected files. Each keyword:<value> pair must be enclosed in quotes if the value contains any spaces. This argument can accept multiple keyword:<value> pairs to make changes to more than one metadata field at once. See the section on programmatic setting of metadata for more information. Example: | ||||||||||||||||||
MODIFIED | /K | <date/time> | Sets the last modified timestamp for selected files and folders. The value for this argument can be given as either a date only, a time only, or a date and time. The accepted formats for the date string are YYYYMMDD or YYYY-MM-DD, and the time string must be in the format HH:MM:SS. If you specify a time as well as a date the time must come after the date, separated by a space, and you must enclose the entire value in quotes (because of the embedded space). If only a time is provided, the file's current date will be preserved (and vice versa). Example: | ||||||||||||||||
now | Sets the last modified timestamp to the current date and time. Example: | ||||||||||||||||||
created | Copies the creation timestamp of the file. Example: | ||||||||||||||||||
taken | For image files, copies the Date Taken timestamp. If the file doesn't have an EXIF tag the last modified timestamp won't be changed. Example: | ||||||||||||||||||
digitized | For image files, copies the Date Digitized timestamp. If the file doesn't have an EXIF tag the last modified timestamp won't be changed. Example: | ||||||||||||||||||
parent | Copies the last modified timestamp from the parent folder. Example: | ||||||||||||||||||
doccreated | For document files, copies the Document Created timestamp. If the file doesn't have this timestamp in its metadata the last modified timestamp won't be changed. Example: | ||||||||||||||||||
docedited | For document files, copies the //Document Last Edited //timestamp. If the file doesn't have this timestamp in its metadata the last modified timestamp won't be changed. Example: | ||||||||||||||||||
docsaved | For document files, copies the Document Last Saved timestamp. If the file doesn't have this timestamp in its metadata the last modified timestamp won't be changed. Example: | ||||||||||||||||||
PIN | /O | (no value) | For cloud files on Windows 10 and above, this command toggles the "pinned" status of the file on and off. This is equivalent to the "Always keep on this device" context menu command that OneDrive adds. When a file is "pinned", it's always kept on the device. When it's "unpinned" it may or may not be kept locally. Example: | ||||||||||||||||
yes | Sets the pinned state on selected cloud files. Example: | ||||||||||||||||||
no | Clears the pinned state on selected cloud files. Example: | ||||||||||||||||||
RECURSE | /O | (no value) | Changes made by this command will be recursively applied to files within selected folders. This does not affect the META argument - only attributes, timestamps and descriptions can be applied recursively. Example: | ||||||||||||||||
no | Prevents the command from working recursively if the recurse option has been turned on by default. Example: | ||||||||||||||||||
SETATTR | /K | <attributes> | Sets the specified attributes for selected files and folders. The specified attributes will be turned on, but other attributes will be untouched. See the description of the ATTR argument for a list of attribute values. Example: | ||||||||||||||||
SETDESCRIPTION | /O | (no value) | Clears the description for selected files and folders. Example: The difference between the DESCRIPTION and SETDESCRIPTION arguments is what they do when not given a value. SETDESCRIPTION clears the description while DESCRIPTION opens a dialog for you to type in a description. | ||||||||||||||||
<description> | Sets the description for selected files and folders to the specified string. Example: | ||||||||||||||||||
TOGGLEATTR | /K | <attributes> | Toggles (inverts) the state of the specified attributes. If each attribute specified is currently set it will be cleared, and vice versa. Attributes that aren't specified will be unaffected. See the description of the ATTR argument for a list of attribute values. Example: | ||||||||||||||||
ZIPCOMMENT | /S | (no value) | Lets you edit the internal Zip comment when viewing the contents of a Zip archive. The comment is stored inside the Zip file and can be displayed by other Zip tools. Example: |
最后更新于