Some rants about technology, PHP, people, tools, web etc from a developers perspective. Feel free to copy ideas, code or anything from here.

Tuesday, October 07, 2008

Spaces in file path in DOS

5 comments
At last i am able to make it work. Thanks to this blog post i am able to get some headway in the problem i was facing. Basically i was running a php script as a batch script and i was not able to make some commands work because they contained space(s) in the path. There is a switch to DIR command in DOS "/X" which tells you the short name for any directory or file name.

So instead of "C:\program files\foo\bar.exe" you can use "C:\PROGRA~1\foo\bar.exe". May be it is helpful to someone.

5 comments :

Anonymous said...

Yes, this was helpful!

Anonymous said...

Thank you!!

Muhammad Saeed said...

I think you can use double quotes like this, instead:

copy "C:\folder 1\file 1.zzz" "D:\folder 2"

:)

Anonymous said...

YOU ARE AWESOME!

Unknown said...

For moving or copting long path files, You can use Long Path Tool. This is one of the best tool used by the people these days.