Export (0) Print
Expand All
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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft