You are not logged in.
Pages: 1
It seems so obvious now, but I've just come up with an elegant (read: with as little coding as possible) and (hopefully) robust way around the problem of "robocopy" spitting the dummy because a "\" has escaped the closing double quote on a path. Usually one falls foul of this by using or "%%~dp1" "%%~dpx" to get the path from a passed parameter or via a "FOR" loop.
Just put a single "dot" at the end.
IE "%%~dpx."
It's so simple I'm kicking myself for not thinking of it earlier.
cmd | *sh | ruby | chef
Offline
havent got a clue what you mean m8
but well done for sorting it
Offline
Well in the simplest example, you use "robocopy" like this:
robocopy "s:\source directory" "t:\target directory"
But if you append a slash to a directory name (e.g. "s:\source directory\"), it takes it as an escape of the closing double quote and thus finds the rest of the line to be faulty.
Keep plugging away at CMD and I'm sure it'll catch you out at some point.
cmd | *sh | ruby | chef
Offline
it catches me out all the time m8
I think ive got a particular bit nailed then bam it gives me a right hook and three hours wasted over something obvious
thats life i guess:D
Offline
wow. nice trick. I just posted in another thread a perhaps OTT solution for that, (but has it's uses in many other scenarios)
http://ss64.org/viewtopic.php?id=797
post 17
Offline
Pages: 1