Menu

How to remove blank space from a filename – one line command

This is for Windows:

The below example is for removing space from all PDF files inside a particular folder.

  1. Open a Command Prompt or PowerShell
  2. Go to the folder with the cd command (eg.: cd “paht of your folder”).
  3. Then input the below :
# get-childitem *.pdf | foreach {rename-item $_ $_.name.replace(" ","")}

 

Hope that has helped. Cheers !

Loading

Categories:   PowerShell, Windows

Comments