Reputation: 757
I have a bat script in a folder called scr
/scr/
script.bat
test.txt
/folder/
testinfolder.txt
When I want to copy test.txt which is in the same folder as the script, I use %~dp0 like this
copy %~dp0test.txt test.txt
What if I want to copy testinfolder.txt which is not in the same folder as the running script, but is one level deeper inside folder. How can I copy that file? I tried this, but it didn't work.
copy %~dp0/folder/testinfolder.txt testinfolder.txt
Upvotes: 0
Views: 380