samquo
samquo

Reputation: 757

calling another batch command from within batch file stops further execution

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

Answers (1)

Raghuram
Raghuram

Reputation: 52665

How about

copy %~dp0folder\testinfolder.txt testinfolder.txt

Upvotes: 2

Related Questions