Okay, I'm trying to pull a registry key value into a variable and am having issues. FOR statements always fuck me up...
Here is what I have so far.
This should work on every 2k/xp machine so feel free to please run it.
What I'm trying to do is take the 3rd part of %KEY% (which should be %USERPROFILE%\My Documents), but I can't get it to work.
Yes, I could use vbscript to do this, but that adds other complexities, so it must be batch. for help.
Here is what I have so far.
Code:
FOR /F "skip=2 delims=~" %%K in ('REG QUERY ^"HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders^" /v Personal') DO SET KEY=%%K
This should work on every 2k/xp machine so feel free to please run it.
What I'm trying to do is take the 3rd part of %KEY% (which should be %USERPROFILE%\My Documents), but I can't get it to work.
Yes, I could use vbscript to do this, but that adds other complexities, so it must be batch. for help.