Batch file question
Posted: 23 Aug 2024 22:09
I have a simple batch file that works great when I run it in the root directory of E:
ROBOCOPY E: G: /MIR /XD $RECYCLE.BIN "System Volume Information" .tmp.drive /R:1 /W:1
PAUSE
But when I ran it from a subdir on E:, it behaved as if I'd rewritten the syntax to be ROBOCOPY E:\Dir G: /MIR (etc.) and erased the entirety of my backup on G:
What is it about Windows *.bat files that makes them act like this, and is there a way I can rewrite it so it will execute the code as written no matter where I run it?
Thanks for any helpful info!
ROBOCOPY E: G: /MIR /XD $RECYCLE.BIN "System Volume Information" .tmp.drive /R:1 /W:1
PAUSE
But when I ran it from a subdir on E:, it behaved as if I'd rewritten the syntax to be ROBOCOPY E:\Dir G: /MIR (etc.) and erased the entirety of my backup on G:
What is it about Windows *.bat files that makes them act like this, and is there a way I can rewrite it so it will execute the code as written no matter where I run it?
Thanks for any helpful info!