• Linkedin
  • Reddit

Summary :

PowerShell delete file

You may want to delete some files that are not important or useful anymore. PowerShell can help you do that job. You will obtain the specific steps to delete file PowerShell from this post of MiniTool.

Quick Navigation :

When files or folders are taking up much space of your computer, which slows the running speed of your PC, you might want to delete them. When you don’t need a file or folder, you can also delete it.

how to speed up windows 10 thumbnail
How to Speed up Windows 10 (Step-by-Step Guide with Pictures)

How to speed up Windows 10? We give you a step-by-step guide to speed up computer Windows 10 effectively.

Read More

In a word, you can execute the deletion operation according to your demand. There are multiple methods to do that job. For instance, you are able to delete the file or folder by putting it into the Recycle Bin, using Command Prompt or utilizing professional tools like MiniTool Partition Wizard.

When you cannot delete a file or folder from your PC, you should utilize some tools to do that operation by force. Read here, you may raise a question “How to Fore Delete a File That Cannot Be Deleted Windows 10”.

Today, I will introduce the Windows built-in utility – PowerShell, which can help you delete files and folders with ease. You have to open Windows PowerShell, identify the file/folder and use the removal command no matter you deleting files or folders.

Open the PowerShell by typing powershell in the search box and clicking on it. After that, follow the steps below to delete files or folders.  

How to Delete File via PowerShell

There are some differences between deleting a single file and multiple files via PowerShell, but they also share some commons. Therefore, the PowerShell delete file part will be divided into two parts.

Command for Deleting a Single File on PowerShell

To delete a single file, you just need to type the following command and hit the Enter key. After that, the PowerShell remove-item command will take effect immediately.

Tip: You should replace the file-path with the actual location of the file.

Remove-item file-path

type the command for deleting a single file and hit Enter

Command for Deleting Multiple Files on PowerShell

If you want to delete multiple files on your computer, you need to type the following command and hit Enter.

Remove-item file-path, file-path1, file-path2

type the command for deleting multiple files and execute the operation

You may notice that this command is very similar to the command to delete a single file, but there is a slight difference.

Tip: In order to delete multiple files at the same time, you have to type all the paths of files.

If you would like to delete files permanently with professional tools, you can refer to the guide.

How to Delete Folder via PowerShell

Similarly, the commands for deleting a single folder and multiple folders are also different. Now, let’s check them one by one.

Command for Deleting a Single Folder on PowerShell

To remove a folder via PowerShell, you need to type the command below in the prompt window and click on Enter.

Remove-Item folder-path

type the command to delete a single folder

Command for Deleting Multiple Folders on PowerShell

Like deleting multiple files, the command for deleting multiple folders should include all the paths of the folders. You can type the following command and hit Enter to carry out the operation.

Remove-item C:\Users\user-name\Desktop\TWC, C:\Users\user-name\Downloads\TWC1

Tip: You need to replace the actual folder path based on your condition.

type the command to delete multiple folders

Now, PowerShell delete file(s) and PowerShell delete folder(s) commands have been introduced to you. It’s your turn to make a choice.

  • Linkedin
  • Reddit

User Comments :