I've been search for a shell (cmd) solution for this for a while and haven't found any. So I wanted to create a Junction but first I need remove the folder if it exists (Junction from sysinterals won't let me ovewrite this).
My first solution was to to run rmdir /S/Q folder\to\be\overwritten
. But if I re-run the script and folder\to\be\overwritten
is already a link pointing to e.g. common\folder
than contents of common\folder
will be whipped out. Not good ;-).
So how to safely remove folder but only that folder in Windows command line? Also note that I need this to work in Windows XP.