pasteasshared
Description
Shares one SOLIDWORKS PDM file, or files found by search, into another vault folder.
The pasteasshared command uses filePath or search to select the source file or files. The directory parameter is the destination vault folder where the shared file entries are created.
This command uses the SOLIDWORKS PDM shared-file behavior. It does not create a copy of the file; it shares the same PDM file into another folder.
Syntax
pasteasshared (-filePath file_path | -search search_query) -directory target_vault_folder [-recursive]
Use -id as an alternative to -filePath for the same operand. A required target still needs one selector, even though each alternative is optional individually. See File IDs and paths for selection rules and command-specific exceptions.
Parameters
| Parameter | Alias | Required | Description |
|---|---|---|---|
-filePath |
No | File to share into the destination directory. Use either -filePath or -search. | |
-search |
No | Search query used to find files to share into the destination directory. Use either -filePath or -search. | |
-directory |
Yes | Destination vault folder where the shared file link will be created. | |
-recursive |
No | When used with search, includes matching files in subfolders. | |
-id |
No | Positive PDM file ID instead of -filePath, identifying the same file that -filePath describes (including a macro, input CSV or existing output file). Requires a connected vault. Shared files with multiple locations require an exact -filePath. Resolving the ID itself does not download, check out or check in the file; the requested command still performs its normal operation. |
More about parameters
filePathOptional. Single source file to share. Use eitherfilePathorsearch.searchOptional. Search query used to find files to share. Use eitherfilePathorsearch.directoryRequired. Destination vault folder where the shared file entries are created.recursiveOptional. When used withsearch, includes matching files in subfolders.
Validation
directoryis required.- Specify either
filePathorsearch, but not both. recursiveapplies only when usingsearch.
Behavior
- Shares each selected source file into the destination folder.
- Keeps the same PDM file ID because this is a shared file, not a copied file.
- Reports files that cannot be shared, for example when a file with the same name already exists in the destination folder or the user does not have permission.
- Skips duplicate search results before attempting to share.
Examples
# pasteasshared
pasteasshared -filePath "Part.sldprt" -directory "Shared Parts"
# pasteasshared
pasteasshared -search "Name=%.sldprt" -directory "Shared Parts"
# pasteasshared
pasteasshared -search "Name=%.sldprt" -directory "Shared Parts" -recursive
Remarks
- The destination
directorymust be a vault folder. - If a file with the same name already exists in the destination folder, SOLIDWORKS PDM refuses the share.
- The user must have permission to share the selected files into the destination 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.