So, I want to make backups from the shadow-copy using batch-script. That's what I have so far:
vssadmin list shadows | findstr /C:"Volume da Cópia de Sombra"
Output:
Volume da Cópia de Sombra: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1
Volume da Cópia de Sombra: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy2
Volume da Cópia de Sombra: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy5
I need to get only the path in the last line returned by findstr, but I really don't know how I'll accomplish it.
And after getting the path and add a \
to the end (it will only make the symbolic link if the path ends with a \
) make a symbolic link to it.
mklink c:\shadowcopy /d %path%
So, I'm lost in the middle of it.
I found this question with an answer:
Batch file to output last line of findstr
But man, batch syntax is a mess and I don't understand a line of code in the answer to adapt it to my project.
Can someone help me and explain in details what i need to do (or the code, if you provide it) so I can understand what I'm doing instead of just paste and copy and, who knows, make some improvements/changes.