How to Delete All of the Files in a Folder on Powershell

Written by keith perry
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Delete All of the Files in a Folder on Powershell
Powershell scripting is useful for administration of Windows computers. (Thinkstock Images/Comstock/Getty Images)

Windows PowerShell is a scripting language built by Microsoft. PowerShell is available on all Windows Operating systems since XP. PowerShell provides access to the cmdlet command or single function tools, providing an easy method to automate administration of the operating system and applications. Simple tasks of copying, moving and deleting files are performed in Powershell. PowerShell programming is excellent for performing tasks repetitively across many computers.

Skill level:

Things you need

  • Windows XP or later
  • PowerShell 1.0 or later

Show MoreHide


  1. 1

    Click on the "Start" icon located on the Windows task bar. Then click "Programs," "Accessories" and "Windows PowerShell" to start the PowerShell program.

  2. 2

    Wait for the window labelled " Windows PowerShell" to appear and a command prompt starting with "PS" to display.

  3. 3

    Enter the text "Remove-Item c:\directoryname*" and press the "Enter" key. Replace the text "directoryname" with the directory in which your files are located.

  4. 4

    Type "dir c:\directoryname" and press "Enter" to verify the files were successfully deleted in Step 3.

  5. 5

    Type "exit" at the Powershell command prompt, and press "Enter" to exit PowerShell.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.