Any suggestions? Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Converting the FileSystemObject's CopyFile Method


Windows PowerShell


Definition: Copies one or more files to a specified location.

CopyFile


Use wildcards with the Copy-Item cmdlet to copy multiple files. This example copies all txt files (files ending with .txt) from C:\Scripts to C:\Scripts\TextFilesOnly:


Copy-Item C:\Scripts\*.txt C:\Scripts\TextFilesOnly


C:\Scripts\TextFilesOnly must already exist for this command to work correctly. See CreateFolder for how to create a folder.


See conversions of other FileSystemObject methods and properties.
Return to the VBScript to Windows PowerShell home page

Show:
© 2016 Microsoft