@ -6658,10 +6658,10 @@ function InputMethod
<#
<#
. SYNOPSIS
. SYNOPSIS
User folders location
Change User folders location
. PARAMETER Root
. PARAMETER Root
Move user folders location to the root of any drive using the interactive menu
Change user folders location to the root of any drive using the interactive menu
. PARAMETER Custom
. PARAMETER Custom
Select folders for user folders location manually using a folder browser dialog
Select folders for user folders location manually using a folder browser dialog
@ -6670,13 +6670,13 @@ function InputMethod
Change user folders location to the default values
Change user folders location to the default values
. EXAMPLE
. EXAMPLE
SetUserShellFolderLocation -Root
Set- UserShellFolderLocation -Root
. EXAMPLE
. EXAMPLE
SetUserShellFolderLocation -Custom
Set- UserShellFolderLocation -Custom
. EXAMPLE
. EXAMPLE
SetUserShellFolderLocation -Default
Set- UserShellFolderLocation -Default
. NOTES
. NOTES
User files or folders won ' t me moved to a new location
User files or folders won ' t me moved to a new location
@ -6684,7 +6684,7 @@ function InputMethod
. NOTES
. NOTES
Current user
Current user
#>
#>
function SetUserShellFolderLocation
function Set- UserShellFolderLocation
{
{
param
param
@ -6719,7 +6719,7 @@ function SetUserShellFolderLocation
The RemoveDesktopINI argument removes desktop . ini in the old user shell folder
The RemoveDesktopINI argument removes desktop . ini in the old user shell folder
. EXAMPLE
. EXAMPLE
UserShellFolder -UserFolder Desktop -FolderPath " $ env:SystemDrive:\Desktop " -RemoveDesktopINI
Set- UserShellFolder -UserFolder Desktop -FolderPath " $ env:SystemDrive:\Desktop " -RemoveDesktopINI
. LINK
. LINK
https : / / docs . microsoft . com / en-us / windows / win32 / api / shlobj_core / nf-shlobj_core -shgetknownfolderpath
https : / / docs . microsoft . com / en-us / windows / win32 / api / shlobj_core / nf-shlobj_core -shgetknownfolderpath
@ -6727,7 +6727,7 @@ function SetUserShellFolderLocation
. NOTES
. NOTES
User files or folders won ' t me moved to a new location
User files or folders won ' t me moved to a new location
#>
#>
function UserShellFolder
function Set- UserShellFolder
{
{
[ CmdletBinding ( ) ]
[ CmdletBinding ( ) ]
param
param
@ -6751,9 +6751,9 @@ function SetUserShellFolderLocation
Redirect user folders to a new location
Redirect user folders to a new location
. EXAMPLE
. EXAMPLE
KnownFolderPath -KnownFolder Desktop -Path " $ env:SystemDrive:\Desktop "
Set- KnownFolderPath -KnownFolder Desktop -Path " $ env:SystemDrive:\Desktop "
#>
#>
function KnownFolderPath
function Set- KnownFolderPath
{
{
[ CmdletBinding ( ) ]
[ CmdletBinding ( ) ]
param
param
@ -6872,7 +6872,7 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
Remove-Item -Path " $ CurrentUserFolderPath\desktop.ini " -Force -ErrorAction Ignore
Remove-Item -Path " $ CurrentUserFolderPath\desktop.ini " -Force -ErrorAction Ignore
}
}
KnownFolderPath -KnownFolder $UserFolder -Path $FolderPath
Set- KnownFolderPath -KnownFolder $UserFolder -Path $FolderPath
New-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name $UserShellFoldersGUIDs [ $UserFolder ] -PropertyType ExpandString -Value $FolderPath -Force
New-ItemProperty -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name $UserShellFoldersGUIDs [ $UserFolder ] -PropertyType ExpandString -Value $FolderPath -Force
# Save desktop.ini in the UTF-16 LE encoding
# Save desktop.ini in the UTF-16 LE encoding
@ -6999,26 +6999,22 @@ public static string GetString(uint strId)
Write-Information -MessageData " " -InformationAction Continue
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . RetrievingDrivesList -Verbose
Write-Verbose -Message $Localization . RetrievingDrivesList -Verbose
# Store all drives letters to use them within ShowMenu function
# Store all fixed disks' letters to use them within ShowMenu function
$DriveLetters = @ ( ( Get-Disk | Where-Object -FilterScript { $_ . BusType -ne " USB " } | Get-Partition | Get-Volume | Where-Object -FilterScript { $null -ne $_ . DriveLetter } ) . DriveLetter | Sort-Object )
# https://learn.microsoft.com/en-us/dotnet/api/system.io.drivetype?view=net-7.0#fields
$DriveLetters = @ ( ( Get-CimInstance -ClassName CIM_LogicalDisk | Where-Object -FilterScript { $_ . DriveType -eq 3 } ) . DeviceID | Sort-Object )
# If the number of disks is more than one, set the second drive in the list as default drive
# If the number of disks is more than one, set the second drive in the list as default drive
if ( $DriveLetters . Count -gt 1 )
if ( $DriveLetters . Count -gt 1 )
{
{
$Script:Default = 1
$Script:Default = 1
}
}
else
{
$Script:Default = 0
}
# Desktop
# Desktop
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . DriveSelect -f $DesktopLocalizedString ) -Verbose
Write-Verbose -Message ( $Localization . DriveSelect -f $DesktopLocalizedString ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Desktop
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Desktop
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DesktopLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DesktopLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7033,23 +7029,28 @@ public static string GetString(uint strId)
{
{
" 0 "
" 0 "
{
{
$SelectedDrive = ShowMenu -Title ( $Localization . DriveSelect -f $DesktopLocalizedString ) -Menu $DriveLetters -Default $Script:Default
if ( $DriveLetters . Count -gt 1 )
UserShellFolder -UserFolder Desktop -FolderPath " $ {SelectedDrive}:\Desktop " -RemoveDesktopINI
{
$SelectedDrive = ShowMenu -Title ( $Localization . DriveSelect -f $DesktopLocalizedString ) -Menu $DriveLetters -Default $Script:Default
}
else
{
$SelectedDrive = $env:SystemDrive
}
Set-UserShellFolder -UserFolder Desktop -FolderPath " $ {SelectedDrive}\Desktop " -RemoveDesktopINI
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Documents
# Documents
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . DriveSelect -f $DocumentsLocalizedString ) -Verbose
Write-Verbose -Message ( $Localization . DriveSelect -f $DocumentsLocalizedString ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Personal
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Personal
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DocumentsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DocumentsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7064,23 +7065,28 @@ public static string GetString(uint strId)
{
{
" 0 "
" 0 "
{
{
$SelectedDrive = ShowMenu -Title ( $Localization . DriveSelect -f $DocumentsLocalizedString ) -Menu $DriveLetters -Default $Script:Default
if ( $DriveLetters . Count -gt 1 )
UserShellFolder -UserFolder Documents -FolderPath " $ {SelectedDrive}:\Documents " -RemoveDesktopINI
{
$SelectedDrive = ShowMenu -Title ( $Localization . DriveSelect -f $DesktopLocalizedString ) -Menu $DriveLetters -Default $Script:Default
}
else
{
$SelectedDrive = $env:SystemDrive
}
Set-UserShellFolder -UserFolder Documents -FolderPath " $ {SelectedDrive}\Documents " -RemoveDesktopINI
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Downloads
# Downloads
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . DriveSelect -f $DownloadsLocalizedString ) -Verbose
Write-Verbose -Message ( $Localization . DriveSelect -f $DownloadsLocalizedString ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DownloadsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DownloadsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7095,23 +7101,28 @@ public static string GetString(uint strId)
{
{
" 0 "
" 0 "
{
{
$SelectedDrive = ShowMenu -Title ( $Localization . DriveSelect -f $DownloadsLocalizedString ) -Menu $DriveLetters -Default $Script:Default
if ( $DriveLetters . Count -gt 1 )
UserShellFolder -UserFolder Downloads -FolderPath " $ {SelectedDrive}:\Downloads " -RemoveDesktopINI
{
$SelectedDrive = ShowMenu -Title ( $Localization . DriveSelect -f $DesktopLocalizedString ) -Menu $DriveLetters -Default $Script:Default
}
else
{
$SelectedDrive = $env:SystemDrive
}
Set-UserShellFolder -UserFolder Downloads -FolderPath " $ {SelectedDrive}\Downloads " -RemoveDesktopINI
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Music
# Music
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . DriveSelect -f $MusicLocalizedString ) -Verbose
Write-Verbose -Message ( $Localization . DriveSelect -f $MusicLocalizedString ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Music "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Music "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $MusicLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $MusicLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7126,23 +7137,28 @@ public static string GetString(uint strId)
{
{
" 0 "
" 0 "
{
{
$SelectedDrive = ShowMenu -Title ( $Localization . DriveSelect -f $MusicLocalizedString ) -Menu $DriveLetters -Default $Script:Default
if ( $DriveLetters . Count -gt 1 )
UserShellFolder -UserFolder Music -FolderPath " $ {SelectedDrive}:\Music " -RemoveDesktopINI
{
$SelectedDrive = ShowMenu -Title ( $Localization . DriveSelect -f $DesktopLocalizedString ) -Menu $DriveLetters -Default $Script:Default
}
else
{
$SelectedDrive = $env:SystemDrive
}
Set-UserShellFolder -UserFolder Music -FolderPath " $ {SelectedDrive}\Music " -RemoveDesktopINI
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Pictures
# Pictures
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . DriveSelect -f $PicturesLocalizedString ) -Verbose
Write-Verbose -Message ( $Localization . DriveSelect -f $PicturesLocalizedString ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Pictures "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Pictures "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $PicturesLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $PicturesLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7157,23 +7173,28 @@ public static string GetString(uint strId)
{
{
" 0 "
" 0 "
{
{
$SelectedDrive = ShowMenu -Title ( $Localization . DriveSelect -f $PicturesLocalizedString ) -Menu $DriveLetters -Default $Script:Default
if ( $DriveLetters . Count -gt 1 )
UserShellFolder -UserFolder Pictures -FolderPath " $ {SelectedDrive}:\Pictures " -RemoveDesktopINI
{
$SelectedDrive = ShowMenu -Title ( $Localization . DriveSelect -f $DesktopLocalizedString ) -Menu $DriveLetters -Default $Script:Default
}
else
{
$SelectedDrive = $env:SystemDrive
}
Set-UserShellFolder -UserFolder Pictures -FolderPath " $ {SelectedDrive}\Pictures " -RemoveDesktopINI
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Videos
# Videos
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . DriveSelect -f $VideosLocalizedString ) -Verbose
Write-Verbose -Message ( $Localization . DriveSelect -f $VideosLocalizedString ) -Verbose
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Video "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Video "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $VideosLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $VideosLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continue
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7188,12 +7209,18 @@ public static string GetString(uint strId)
{
{
" 0 "
" 0 "
{
{
$SelectedDrive = ShowMenu -Title ( $Localization . DriveSelect -f $VideosLocalizedString ) -Menu $DriveLetters -Default $Script:Default
if ( $DriveLetters . Count -gt 1 )
UserShellFolder -UserFolder Videos -FolderPath " $ {SelectedDrive}:\Videos " -RemoveDesktopINI
{
$SelectedDrive = ShowMenu -Title ( $Localization . DriveSelect -f $DesktopLocalizedString ) -Menu $DriveLetters -Default $Script:Default
}
else
{
$SelectedDrive = $env:SystemDrive
}
Set-UserShellFolder -UserFolder Videos -FolderPath " $ {SelectedDrive}\Videos " -RemoveDesktopINI
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
@ -7201,10 +7228,10 @@ public static string GetString(uint strId)
" Custom "
" Custom "
{
{
# Desktop
# Desktop
Write-Information -MessageData " " -InformationAction Continue
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Desktop
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Desktop
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DesktopLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continu e
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DesktopLocalizedString , $CurrentUserFolderLocation ) -Verbos e
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7230,22 +7257,21 @@ public static string GetString(uint strId)
if ( $FolderBrowserDialog . SelectedPath )
if ( $FolderBrowserDialog . SelectedPath )
{
{
UserShellFolder -UserFolder Desktop -FolderPath $FolderBrowserDialog . SelectedPath -RemoveDesktopINI
Set- UserShellFolder -UserFolder Desktop -FolderPath $FolderBrowserDialog . SelectedPath -RemoveDesktopINI
Write-Verbose -Message ( $Localization . NewUserFolderLocation -f $FolderBrowserDialog . SelectedPath ) -Verbose
Write-Verbose -Message ( $Localization . NewUserFolderLocation -f $FolderBrowserDialog . SelectedPath ) -Verbose
}
}
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Documents
# Documents
Write-Information -MessageData " " -InformationAction Continue
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Personal
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Personal
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DocumentsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continu e
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DocumentsLocalizedString , $CurrentUserFolderLocation ) -Verbos e
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7271,22 +7297,21 @@ public static string GetString(uint strId)
if ( $FolderBrowserDialog . SelectedPath )
if ( $FolderBrowserDialog . SelectedPath )
{
{
UserShellFolder -UserFolder Documents -FolderPath $FolderBrowserDialog . SelectedPath -RemoveDesktopINI
Set- UserShellFolder -UserFolder Documents -FolderPath $FolderBrowserDialog . SelectedPath -RemoveDesktopINI
Write-Verbose -Message ( $Localization . NewUserFolderLocation -f $FolderBrowserDialog . SelectedPath ) -Verbose
Write-Verbose -Message ( $Localization . NewUserFolderLocation -f $FolderBrowserDialog . SelectedPath ) -Verbose
}
}
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Downloads
# Downloads
Write-Information -MessageData " " -InformationAction Continue
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DownloadsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continu e
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DownloadsLocalizedString , $CurrentUserFolderLocation ) -Verbos e
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7312,22 +7337,21 @@ public static string GetString(uint strId)
if ( $FolderBrowserDialog . SelectedPath )
if ( $FolderBrowserDialog . SelectedPath )
{
{
UserShellFolder -UserFolder Downloads -FolderPath $FolderBrowserDialog . SelectedPath -RemoveDesktopINI
Set- UserShellFolder -UserFolder Downloads -FolderPath $FolderBrowserDialog . SelectedPath -RemoveDesktopINI
Write-Verbose -Message ( $Localization . NewUserFolderLocation -f $FolderBrowserDialog . SelectedPath ) -Verbose
Write-Verbose -Message ( $Localization . NewUserFolderLocation -f $FolderBrowserDialog . SelectedPath ) -Verbose
}
}
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Music
# Music
Write-Information -MessageData " " -InformationAction Continue
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Music "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Music "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $MusicLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continu e
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $MusicLocalizedString , $CurrentUserFolderLocation ) -Verbos e
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7353,22 +7377,21 @@ public static string GetString(uint strId)
if ( $FolderBrowserDialog . SelectedPath )
if ( $FolderBrowserDialog . SelectedPath )
{
{
UserShellFolder -UserFolder Music -FolderPath $FolderBrowserDialog . SelectedPath -RemoveDesktopINI
Set- UserShellFolder -UserFolder Music -FolderPath $FolderBrowserDialog . SelectedPath -RemoveDesktopINI
Write-Verbose -Message ( $Localization . NewUserFolderLocation -f $FolderBrowserDialog . SelectedPath ) -Verbose
Write-Verbose -Message ( $Localization . NewUserFolderLocation -f $FolderBrowserDialog . SelectedPath ) -Verbose
}
}
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Pictures
# Pictures
Write-Information -MessageData " " -InformationAction Continue
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Pictures "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Pictures "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $PicturesLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continu e
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $PicturesLocalizedString , $CurrentUserFolderLocation ) -Verbos e
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7394,22 +7417,21 @@ public static string GetString(uint strId)
if ( $FolderBrowserDialog . SelectedPath )
if ( $FolderBrowserDialog . SelectedPath )
{
{
UserShellFolder -UserFolder Pictures -FolderPath $FolderBrowserDialog . SelectedPath -RemoveDesktopINI
Set- UserShellFolder -UserFolder Pictures -FolderPath $FolderBrowserDialog . SelectedPath -RemoveDesktopINI
Write-Verbose -Message ( $Localization . NewUserFolderLocation -f $FolderBrowserDialog . SelectedPath ) -Verbose
Write-Verbose -Message ( $Localization . NewUserFolderLocation -f $FolderBrowserDialog . SelectedPath ) -Verbose
}
}
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Videos
# Videos
Write-Information -MessageData " " -InformationAction Continue
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Video "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Video "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $VideosLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continu e
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $VideosLocalizedString , $CurrentUserFolderLocation ) -Verbos e
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7435,13 +7457,12 @@ public static string GetString(uint strId)
if ( $FolderBrowserDialog . SelectedPath )
if ( $FolderBrowserDialog . SelectedPath )
{
{
UserShellFolder -UserFolder Videos -FolderPath $FolderBrowserDialog . SelectedPath -RemoveDesktopINI
Set- UserShellFolder -UserFolder Videos -FolderPath $FolderBrowserDialog . SelectedPath -RemoveDesktopINI
Write-Verbose -Message ( $Localization . NewUserFolderLocation -f $FolderBrowserDialog . SelectedPath ) -Verbose
Write-Verbose -Message ( $Localization . NewUserFolderLocation -f $FolderBrowserDialog . SelectedPath ) -Verbose
}
}
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
@ -7449,10 +7470,10 @@ public static string GetString(uint strId)
" Default "
" Default "
{
{
# Desktop
# Desktop
Write-Information -MessageData " " -InformationAction Continue
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Desktop
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Desktop
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DesktopLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continu e
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DesktopLocalizedString , $CurrentUserFolderLocation ) -Verbos e
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7467,20 +7488,19 @@ public static string GetString(uint strId)
{
{
" 0 "
" 0 "
{
{
UserShellFolder -UserFolder Desktop -FolderPath " $ env:USERPROFILE\Desktop " -RemoveDesktopINI
Set- UserShellFolder -UserFolder Desktop -FolderPath " $ env:USERPROFILE\Desktop " -RemoveDesktopINI
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Documents
# Documents
Write-Information -MessageData " " -InformationAction Continue
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Personal
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name Personal
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DocumentsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continu e
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DocumentsLocalizedString , $CurrentUserFolderLocation ) -Verbos e
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7495,20 +7515,19 @@ public static string GetString(uint strId)
{
{
" 0 "
" 0 "
{
{
UserShellFolder -UserFolder Documents -FolderPath " $ env:USERPROFILE\Documents " -RemoveDesktopINI
Set- UserShellFolder -UserFolder Documents -FolderPath " $ env:USERPROFILE\Documents " -RemoveDesktopINI
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Downloads
# Downloads
Write-Information -MessageData " " -InformationAction Continue
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DownloadsLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continu e
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $DownloadsLocalizedString , $CurrentUserFolderLocation ) -Verbos e
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7523,20 +7542,19 @@ public static string GetString(uint strId)
{
{
" 0 "
" 0 "
{
{
UserShellFolder -UserFolder Downloads -FolderPath " $ env:USERPROFILE\Downloads " -RemoveDesktopINI
Set- UserShellFolder -UserFolder Downloads -FolderPath " $ env:USERPROFILE\Downloads " -RemoveDesktopINI
}
}
" 1 "
" 1 "
{
{
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Information -MessageData " " -InformationAction Continue
}
}
}
}
# Music
# Music
Write-Information -MessageData " " -InformationAction Continue
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Music "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Music "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $MusicLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continu e
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $MusicLocalizedString , $CurrentUserFolderLocation ) -Verbos e
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7551,20 +7569,19 @@ public static string GetString(uint strId)
{
{
" 0 "
" 0 "
{
{
UserShellFolder -UserFolder Music -FolderPath " $ env:USERPROFILE\Music " -RemoveDesktopINI
Set- UserShellFolder -UserFolder Music -FolderPath " $ env:USERPROFILE\Music " -RemoveDesktopINI
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Pictures
# Pictures
Write-Information -MessageData " " -InformationAction Continue
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Pictures "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Pictures "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $PicturesLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continu e
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $PicturesLocalizedString , $CurrentUserFolderLocation ) -Verbos e
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
$Title = " "
$Title = " "
@ -7579,24 +7596,21 @@ public static string GetString(uint strId)
{
{
" 0 "
" 0 "
{
{
UserShellFolder -UserFolder Pictures -FolderPath " $ env:USERPROFILE\Pictures " -RemoveDesktopINI
Set- UserShellFolder -UserFolder Pictures -FolderPath " $ env:USERPROFILE\Pictures " -RemoveDesktopINI
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}
# Videos
# Videos
Write-Information -MessageData " " -InformationAction Continue
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Video "
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " My Video "
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $VideosLocalizedString , $CurrentUserFolderLocation ) -Verbose
Write-Information -MessageData " " -InformationAction Continu e
Write-Verbose -Message ( $Localization . CurrentUserFolderLocation -f $VideosLocalizedString , $CurrentUserFolderLocation ) -Verbos e
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Warning -Message $Localization . FilesWontBeMoved
Write-Information -MessageData " " -InformationAction Continue
$Title = " "
$Title = " "
$Message = $Localization . UserDefaultFolder -f $VideosLocalizedString
$Message = $Localization . UserDefaultFolder -f $VideosLocalizedString
$Yes = $Localization . Yes
$Yes = $Localization . Yes
@ -7609,11 +7623,10 @@ public static string GetString(uint strId)
{
{
" 0 "
" 0 "
{
{
UserShellFolder -UserFolder Videos -FolderPath " $ env:USERPROFILE\Videos " -RemoveDesktopINI
Set- UserShellFolder -UserFolder Videos -FolderPath " $ env:USERPROFILE\Videos " -RemoveDesktopINI
}
}
" 1 "
" 1 "
{
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message $Localization . Skipped -Verbose
Write-Verbose -Message $Localization . Skipped -Verbose
}
}
}
}