How do I use spaces in the Command Prompt?

faressoft picture faressoft · Jun 16, 2011 · Viewed 618.7k times · Source

How can I use spaces in the Windows Command Line?

cmd /C C:\Program Files (x86)\WinRar\Rar.exe a D:\Hello 2\File.rar D:\Hello 2\*.*

Answer

sakra picture sakra · Jun 16, 2011

Single quotation marks won't do in that case. You have to add quotation marks around each path and also enclose the whole command in quotation marks:

cmd /C ""C:\Program Files (x86)\WinRar\Rar.exe" a "D:\Hello 2\File.rar" "D:\Hello 2\*.*""