Batch - copy file using relative path

Dan picture Dan · Sep 10, 2013 · Viewed 73.1k times · Source

I'm a beginner with batch. I would like to copy file in \Debug\test.ext into ..\..\new by batch command.

I tried copy "\Debug\text.txt" "..\..\new", but get error "the system cannot find the file specified"

Answer

Stephan picture Stephan · Sep 10, 2013

if you start your path with \, it's an absolute, not a relative path. Try copy "Debug\text.txt" "..\..\new" instead