| > William, I somewhat understand what you are asking
> of me, and I have attempted to reconcile the syntax,
> but to no avail.
>
> This is my failed attempt:
> FOR /R "C:\\Users\\Jerry Lee\\Desktop\\test\\ESE 211" %G (.)
> DO (
> md "C:\\Users\\Jerry Lee\\Desktop\\test\\dogs"
> fsutil hardlink create . *
>
> )
>
> The source HTTrack project is ESE 211; I captured
> the mirror for this website and copied over the
> project itself (.whtt) and the directory containing
> all of the website files (this directory is called
> "ESE 211"). I believe you want me to utilize a for
> loop within the batch file to recursively put
> hard-linked files in a new directory of my choosing,
> here called "dogs". Surely my syntax is off in some
> way; any suggestions would be much appreciated.
Somewhat close. To do it in one pass you'll need delayed expansion.
setlocal enableDelayedExpansion||exit/b
FOR /R "C:\\Users\\Jerry Lee\\Desktop\\test\\ESE 211" %%G (.) DO (
set fromFile="%%~G"
set fromDir="%%~dpG"
md !fromDir:\\ESE 211=\\dogs! 2>nul
fsutil hardlink create !fromFile:\\ESE 211=\\dogs! "%%~G"
)
| |