|
Hi,
I have got a simple task for kix that I have mastered in a batch script but want to place it in my logon kix script. I want to read the registry to see which server the roaming profile is being stored on.
The result will be \\server\profiles$\username.v2 [the new Windows 7 profile path] and this will be saved as $new_prof
I also want a variable $old_prof which is the same as $new_prof except that is doesn't have the .v2 extension
Basically, I want to run this from within my kix script
shell '%comspec% /c for /f "tokens=3" %%C in ("c:\windows\system32\reg.exe" query "hklm\software\microsoft\Windows NT\CurrentVersion\Profilelist" /s /f centralprofile ^| find "REG_SZ") do set $new_prof=%%c'
Then I check to see if $new_prof exists before proceeding at which point it fails.
1) How do I check what I am getting in variable $new_prof if anything? 2) How might I truncate $new_prof to be $old_prof [ie. missing the .v2]
Thanks in advance for your help
Edited by Devlin7 (2012-04-03 01:23 AM)
|