Collections:
Other Resources:
Delete Directory or File in Windows PowerShell
How to delete a directory or file to a new location in Windows PowerShell? Can I use the old "del" command?
✍: FYIcenter.com
Yes, you can still use the old "del" command in Windows PowerShell. But "del" is defined as an alias of the "Remove-Item" cmdlet.
The "Remove-Item" cmdlet deletes one or more items, like directories and files. The "Move-Item" cmdlet requires 1 minimum parameter:
The example below deletes all of the files with names that include a dot (.) from the C:\Test directory. Because the command specifies a dot, the command does not delete directories or files with no file name extension.
PS C:\fyicenter> Remove-Item C:\Test\*.*
The example below deletes from the current directory all files with a .doc file name extension and a name that does not include "1". It uses the wildcard character (*) to specify the contents of the current directory. It uses the Include and Exclude parameters to specify the files to delete.
PS C:\fyicenter> Remove-Item * -Include *.doc -Exclude *1*
The example below deletes a file that is both hidden and read-only. It uses the Path parameter to specify the file. It uses the Force parameter to give permission to delete it. Without Force, you cannot delete read-only or hidden files.
PS C:\fyicenter> Remove-Item -Path C:\Test\hidden-RO-file.txt -Force
⇒ Get File Properties in Windows PowerShell
⇐ Copy Directory or File in Windows PowerShell
2016-10-22, 1765🔥, 0💬
Popular Posts:
the computer detect the microphone plugged in, but it's not working with any App. or Desktop soft we...
What is QLBCTRL.exe - Process - QLB Controller? Process QLBCTRL.exe is the QLB (Quick Launch Button)...
UpdateUI.exe at startup ,how to remove it Actually, you should keep UpdaterUI.exe as a startup, beca...
Where to find information about what services are running on Windows 8 and how to manage them? I wan...
A new tab called "Boot" is added in "msconfig" tool on Windows Vista and Windows 7. What is this "Bo...