copy
Description
Performs a vault-to-vault copy operation in SOLIDWORKS PDM.
The copy command creates new files with new File IDs inside the vault by copying:
- A single file
- All files in a folder
- Files found using a search scoped to a source folder
This command does not add files from disk and does not modify the original files.
Syntax
copy -source -directory -search -recursive -name -ignoreexisting
Parameters
| Parameter | Alias | Required | Description |
|---|---|---|---|
-source |
No | The complete file path of the file to copy. You can also specify a folder path. This will copy the files in that folder. Temp files starting with ~ are ignored. | |
-directory |
-dir |
No | Target directory where to copy the file(s) to. Must be in the vault. |
-search |
No | Search query. Use this to copy all search results | |
-recursive |
No | Affects the search parameter. Specify -recursive to make the search recursive. The start location is the current directory | |
-name |
No | Specifies the new name(s) of the file(s). Please include the extension. You can use dynamic placerholders. Example: $namewithoutextension$extension (or $name) keeps the old file name. | |
-ignoreexisting |
-ignoreex |
No | Not implemented in this version of PDMShell. Do not use. |
More about parameters
source
The source file or folder inside the vault.- If a file path is provided (ends with an extension), only that file is copied.
- If a folder path is provided, all matching files in that folder are copied.
- Relative paths are resolved against the current folder.
directory
The destination folder inside the vault where files will be copied.search
Optional PDM search keyword used to filter files in the source folder.
The search is scoped to the source folder and supports%wildcards.recursive
Optional. When used withsearch, includes subfolders of the source folder.name
Required. Specifies the destination file name.
Alias expressions are evaluated only for the destination name. Extension required.ignoreexisting
Not implemented
Examples
Copy a single file to another folder
copy -source part1.sldprt -directory /Vault/Projects/Released -name part2.sldprt
Copy a file and rename it
copy -source part1.sldprt -directory /Vault/Projects/Released -name part1_revA.sldprt
Copy all files from a folder
copy -source Vault/Projects/WIP -directory /Vault/Projects/Released -name "$namewithouextension-new$extension"
Copy files using a search filter
copy -source Vault/Projects/WIP -search %.slddrw -directory Vault/Projects/Released -name "$namewithouextension-new$extension"
Copy files and append new to the old name
copy -source Vault/Projects/WIP -search %.sldprt -directory Vault/Projects/Released -name "$namewithouextension-new$extension"
Remarks
- If
sourceis a file,searchandrecursiveare ignored. - If
sourceis a folder andsearchis not provided, all files in that folder are copied. - The
searchparameter does not search the entire vault, only the source folder
Search results report
Add -csv "C:\Reports\results.csv" when using -search to save operation results. The first columns are file ID, parent folder ID, file name and output, followed by status and error details. The report folder must exist. New vault reports are added to PDM; existing vault reports must be checked out by you on this computer and remain checked out. External reports are replaced. See CSV operation reports for command-specific outcomes.