I'm using "D:\users" profilePath for my Domain users. When I change my "systemdrive" with new windows image, Domain users creates new profile like "D:\Users\old.DNS".
I want to use old profilepath but I couldn't find any method to tell windows "use existing profile". Because of that I need to change profile path from regedit!
I tried to write something but I don't know how can I modify the registry only changes "dnsname".
Because username is different for every machine and also DNSname can be different for different companies.
I'm taking user sid with
set sid=wmic useraccount where name='%username%' get sid
%sid%
Then I need to take username and remove .DNS from it, but I don't know how can I do that. Can i write someting like "delete after "." "point" in batch?