Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to change profile directory?

Featured Replies

Dear Export,

I'm using Win2k3 unattended installation to change the profile directory to another partition (I use C for normal system files and D for profiles). Yes, I know how to do it in winnt.sif. But my problem is I use a new HDD, and I partition it into two partitions. The Windows installer only lets me do partitioning; there's no way to format ALL the partitions before I install it.

Therefore, if I instruct the installer to place the profile directory in to D (the second partition), and because I cannot format D, the installer will report an error and cannot continue.

Is there any way to achieve this?

Thanks in advance!

Lei

Use a partition program before u install windows :)

(but that's probably not the solution you're looking for :) )

You could use the attached script. It asks for the new folder for the userprofiles, copies the folder of default user and all users and sets the entry in the registry, so that new profiles will be generated in the new location. Already existing profiles aren't touched.

Save the following as profiles.vbs and run it

-------------------------------------------------------------------------------------------------

Set wshshell = CreateObject("WScript.Shell")

Set fs = CreateObject("Scripting.FileSystemObject")

value_user = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Profilelist\ProfilesDirectory"

dir_docs = wshshell.RegRead(value_user)

Do

answer = vbYes

resiltat1 = 0

resultat2 = 0

'Dialog zur Auswahl des Ordners für die Profile öffnen

userfolder = folderbrowse

'Falls Cancel gedrückt wurde, das Skript beenden

If ( userfolder = "" ) Then

WScript.Quit

End If

pos = Instr (userfolder,":")

If NOT ( pos = 2 ) Then

Msgbox userfolder & " is not a valid directory. Please choose another one!"

Else

Set userfolderO = fs.Getfolder(userfolder)

If ( userfolderO.Subfolders.count > 0 ) OR (userfolderO.files.count > 0 ) Then

answer = Msgbox (userfolder &" is not empty. Overwrite?", vbYesNo + vBQuestion)

If ( answer = vbYes) AND (len(userfolder) > 3) Then

On Error Resume Next

fs.Deletefolder(userfolder)

End If

End If

If NOT ( answer = vbNo ) Then

dir_docs = wshshell.ExpandEnvironmentStrings(dir_docs)

befehl ="xcopy /o/h/e/i/y/q """ & dir_docs & "\all users"" """ & userfolder & "\all users"""

kommando = "%COMSPEC% /C " & befehl

resultat1 = wshshell.Run ( kommando, 1, True )

befehl ="xcopy /o/h/e/i/y/q """ & dir_docs & "\default user"" """ & userfolder & "\default user"""

kommando = "%COMSPEC% /C " & befehl

resultat2 = wshshell.Run ( kommando, 1, True )

If ( resultat1 <> 0 ) OR ( resultat2 <> 0 ) Then

msgbox "Copy failed! Please choose another directory"

If (len(userfolder) = 3) Then

On Error Resume Next

fs.Deletefolder(userfolder & """\all users""")

On Error Resume Next

fs.Deletefolder(userfolder & """\default user""")

Else

fs.Deletefolder(userfolder)

End If

End If

End If

End If

loop while (resultat1 <> 0) OR (resultat2 <> 0) OR ( answer =vbNo ) OR ( NOT pos = 2)

wshshell.RegWrite value_user,userfolder

Function folderBrowse

On Error Resume Next

Set slapp = WScript.CreateObject("Shell.Application")

Set V = slapp.BrowseForFolder (0, "Choose the new folder for the userprofiles ( or press cancel, if you don't want to move it)", 0, &H11)

If err.number <> 0 Then

folderBrowse = "Error number " & err.number

err.clear

Exit Function

End If

folderBrowse = V.self.path

End Function

  • Author
You could use the attached script. It asks for the new folder for the userprofiles, copies the folder of default user and all users and sets the entry in the registry, so that new profiles will be generated in the new location. Already existing profiles aren't touched.

Hi Doc,

Thanks for your reply. Yes, change the profile location for all the users is the second best solution if my original problem cannot be fixed. As a matter of fact, I did this menually before I tried to use unattended install approach. Where can I find such a script? Ta.

Lei

  • Author

Hi Doc,

Thanks for your script. I tested on my machine, and it looks ok. However, by searching the registry, I found not all the paths containing "All Users" are modofied. Is it safe to use?

Thanks,

Lei

Which entries do you mean? I use the script since a few months and didn't come across any probglem. But perhaps I overlooked a fault.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.