Converting the FileSystemObject's DeleteFile Method

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