Anyone got time for some more batch scripting???

fly

omg
Oct 1, 2004
79,102
27,214
1,323
Marklar
₥84,111
Steam
mattressfish
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.
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. :heart: for help.
 
fly > fg in the computing department.
Computing is a very vague term. If you want someone to make a perfect, right down to the very last pit, copy of an audio CD that is me. If you want batch scripting ask fly :p
 
yeah I probably would have just called a vbs file to do it - good job knocking it out at the bat level though - mad props
 
oooh, copying a cd...you're a fucking jedi knight! :p

Look, I don't know what you think you saw about any copying of the Jedi Knight CD, but that's a bunch of crap and I won't stand for you making outrageous claims against me.
 
yeah I probably would have just called a vbs file to do it - good job knocking it out at the bat level though - mad props

I needed to add it to an existing logon batch file and adding a separate vbs script would have complicated things elsewhere. BTW, I cheated and crossposted this at another forum. :p

Code:
FOR /F "skip=4 tokens=2*" %%i in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Personal') DO SET KEY=%%j

I essentially wrote a system, by hand, that will replace Citrix for us. By replacing Citrix, I mean the ability to swap machines in and out at the call center without any downtime for users. Oh, and it also means that Windows XP reinstalls itself approximately every 30 days. And that users can reinstall the system by themselves as well if something goes tits up. It's pretty fucking cool if I do say so myself.
 
Last edited:
TELL ME HOW TO KILL LICHEN!

underworld_evolution_1.jpg