Monday, 29 April 2019

Windows Installation and user profile path


I am just about to format my computer as I'm a frequent "clean type of person". The problems while installing Windows is that I always have to manually change location for my user files to d:/user files/{name}/music or videos etc. Now I'm using a ssd drive I would also like my appdata to be moved too that location aswell.


I know this is all possible through registry changes BUT the last time I attempted the relocation. It deleted all files within the target path and created fresh empty directories for my music, my videos etc. How can I accomplish this on a clean install, even logging in as admininistrator prior too any user account creations and point the profile paths to an already existing directory with files in it?



Answer



After some trial and error, it seems that the best method was to install windows, login to the admin during post installation.


Edit the registry @


 HKEY_LOCAL_MACHINE/SOFTWARE/MICROSOFT/WINDOWS NT/CurrentVersion/ProfileList 

Then change default, ProfilesDirectory and public to the desired paths.


I had played around with linking both symbolic and junction but for some strange reason it didn't work as expected and kept logging out while trying to log in. Also changing HKEY_LOCAL_MACHINE/SOFTWARE/MICROSOFT/WINDOWS NT/CurrentVersion/ProfileList/{profile id} (won't be hard to find when you see where the ProfileImagePath is pointing to) didn't work as expected either after creating the account.


I can't recall the problem but I think it was the same issue as mklink. The failures may have to do with the order I did things etc but in return the above method I had mention works for me, but be careful, if you create an account and that path exists with your files already there, it will wipe it all and create a fresh user directory.


So if you already have a profile at D:\users\{username} and wish windows to use that path for you new installation.. then make sure you rename it first eg D:\users\{username}.old then create the profile and cut and paste the contents from old into the newly created profile path. This will be instant considering the files are located on the same drive.


Now if you do not wish to do this every time you install windows, you can make a quick script too automatically do it for you.


Once Windows has finished installing, it will run any commands that you place in {windowscd}\$OEM$(maybe different for others but I'm not sure)\$$\SETUP\SCRIPTSSETUPCOMPLETE.CMD, then just enter the same process in that file. You may wish to use an usb device for this as CD's aren't writeable and there are plenty off methods out there in how to install windows from usb.


You can change registry settings, create user accounts, rename and move files straight from commands which fits the solution nicely...


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...