Export (0) Print
Expand All
Expand Minimize

Converting the FileSystemObject's DeleteFile Method


Windows PowerShell


Definition: Deletes one or more files.

DeleteFile


See Delete. The only difference is that DeleteFile allows you to delete more than one file at once. You can use the Remove-Item cmdlet to delete multiple files. For example, you can use wildcards to delete all the .txt files from a folder:


Remove-Item C:\scripts\temp2\*.txt
del C:\scripts\temp2\*.txt


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