Git Product home page Git Product logo

sophia-script-for-windows's Introduction

trophy

line

Hi, I am Dmitry from Moscow. Passionate about Microsoft services, Windows & PowerShell. Learning technologies that I found interesting.

Yandex Telegram Telegram Telegram

  • Open-source enthusiast and maintainer 🖥️
  • Love to help people 🔌
  • I do like automation 🤖
  • I work on Sophia Script, the largest PowerShell module for fine-tuning Windows 10 & Windows 11 on GitHub, and its' GUI version, SophiApp ⌨️

Card Card

Windows VSCode WindowsTerminal PowerShell Firefox

line

Card

sophia-script-for-windows's People

Contributors

alan-null avatar alejandroakbal avatar benchtweakgaming avatar couleurm avatar danielk-98 avatar danijeljw avatar domikuss avatar eggeeghigaeg avatar farag2 avatar flashercs avatar guihkx avatar henry2o1o avatar hypnootika avatar iamteerawut avatar inv2004 avatar lowl1f3 avatar maurvick avatar savchenko avatar schweinepriester avatar thebossmagnus avatar theexentist151 avatar udev2019 avatar wseng avatar zimmersi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sophia-script-for-windows's Issues

Making the script more user-friendly: Encapsulation and separation of concerns

Hello. 😊

This script currently packs 150+ functions; anyone willing to apply only a subset of them needs to open the script and comment out the relevant section. The problem is, this person must know enough PowerShell to be able to distinguish sections in the first place. If they miss commenting out the closing }, the result could be quite unexpected.

One of the principles of writing good code is: Use functions to avoid code repetition.

Technique 1

Currently, there are a lot of sections in the script that look like this:

if (-not (Test-Path $SomeRegistryPath))
{
	New-Item -Path $SomeRegistryPath -Force
}
New-ItemProperty -Path $Path -Name $Name -PropertyType DWord -Value $Value -Force

...or simply, this:

New-ItemProperty -Path $Path -Name $Name -PropertyType DWord -Value $Value -Force

It can be encapsulated into a function, like this:

function Set-RegistryDword {
  [CmdletBinding()]
  param (
    [String]$Path,
    [string]$Name,
    [Int64]$Value
  )

  if (-not (Test-Path $Path))
  {
    New-Item -Path $Path -Force
  }
  New-ItemProperty -Path $Path -Name $Name -PropertyType DWord -Value $Value -Force
}

You can use this function to encapsulate the data and logic separately. Here is how lines 343 through 395 would look like:

function Set-RegistryDword {
  [CmdletBinding()]
  param (
    [String]$Path,
    [string]$Name,
    [Int64]$Value
  )

  if (-not (Test-Path $Path))
  {
    New-Item -Path $Path -Force
  }
  New-ItemProperty -Path $Path -Name $Name -PropertyType DWord -Value $Value -Force
}

$SettingsToSet = @(
  # Do not suggest ways I can finish setting up my device to get the most out of Windows
  # Не предлагать способы завершения настройки устройства для максимально эффективного использования Windows
  ('HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement','ScoobeSystemSettingEnabled',0),

  # Do not offer tailored experiences based on the diagnostic data setting
  # Не предлагать персонализированные возможности, основанные на выбранном параметре диагностических данных
  ('HKCU:\Software\Microsoft\Windows\CurrentVersion\Privacy','TailoredExperiencesWithDiagnosticDataEnabled',0),

  # Show "This PC" on Desktop
  # Отобразить "Этот компьютер" на рабочем столе
  ('HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel','"{20D04FE0-3AEA-1069-A2D8-08002B30309D}"',0),

  # Do not use check boxes to select items
  # Не использовать флажки для выбора элементов
  ('HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced','AutoCheckSelect',0),

  # Show hidden files, folders, and drives
  # Показывать скрытые файлы, папки и диски
  ('HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced','Hidden',1),

  # Show file name extensions
  # Показывать расширения для зарегистрированных типов файлов
  ('HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced','HideFileExt',0),

  # Do not hide folder merge conflicts
  # Не скрывать конфликт слияния папок
  ('HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced','HideMergeConflicts',0),

  # Open File Explorer to: "This PC"
  # Открывать проводник для: "Этот компьютер"
  ('HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced','LaunchTo',1),

  # Do not show all folders in the navigation pane
  # Не отображать все папки в области навигации
  ('HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced','NavPaneShowAllFolders',0),

  # Do not show Cortana button on taskbar
  # Не показывать кнопку Кортаны на панели задач
  ('HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced','ShowCortanaButton',0),

  # Do not show sync provider notification within File Explorer
  # Не показывать уведомления поставщика синхронизации в проводнике
  ('HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced','ShowSyncProviderNotifications',0),

  # Do not show Task View button on taskbar
  # Не показывать кнопку Просмотра задач
  ('HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced','ShowTaskViewButton',0)
)

if ($SettingsToSet.Count -ne 0) {
  foreach ($item in $SettingsToSet) {
    Set-RegistryDword -Path $item[0] -Name $item[1] -Value $item[2]
  }
}

Two things have happened:

  1. Commenting out the undesired settings has become much easier for the laymen, as they don't see the technical New-ItemProperty part.
  2. Who says they have to edit the script? You can put the settings into a separate .xml file. The user simply edits that file instead of editing the script. That way, if one day, you decided to port your code to C#, Python, or Node.js, well, you can just port the logic.

There caveats though:

  1. Some parts of the script aren't as easy to encapsulate.
  2. Some objectives can only be accomplished by setting two or more Registry values at once, or by running other commands, like dism or taskman. Here's when Technique 2 helps.

Technique 2

It possible to break this script into two files: Win 10 2004 Main.ps1 and Win 10 2004 Logic.psm1.

Win 10 2004 Logic.psd1 would look like this:

# Set the minimal operating system diagnostic data level
# Установить минимальный уровень отправляемых диагностических сведений
function Set-OsDiagLevelFarag {
  if ((Get-WindowsEdition -Online).Edition -eq "Enterprise" -or (Get-WindowsEdition -Online).Edition -eq "Education")
  {
    # "Security"
    # "Безопасность"
    New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 0 -Force
  }  
  else
  {
    # "Basic"
    # "Базовый"
    New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 1 -Force
  }   
}  

# Turn off Windows Error Reporting
# Отключить отчеты об ошибках Windows
function Disable-WindowsErrorReportingFarag {
  New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Windows Error Reporting" -Name Disabled -PropertyType DWord -Value 1 -Force
}

# 
# ...
# ...
# ...
# 

As you can see, this sample code is just the lines 219 through 236 of the script. The only change here is the addition of function {} definition.

Now, the Win 10 2004 Main.ps1 could look like this:

Import-Module `Win 10 2004 Logic.psm1` -Scope Local # Maybe "Local" isn't appropriate. Let's check PowerShell help later.

Set-OsDiagLevelFarag 
Disable-WindowsErrorReportingFarag
# 
# ...
# ...
# ...
# 

This script just calls functions inside Win 10 2004 Logic.psm1. Disabling the functions that the user doesn't need is a matter of commenting only one line.

But there is something even better: People can import Win 10 2004 Logic.psm1 and just run one or two of its functions.

Which technique to use? 1 or 2?

Both. Technique 1 is useful for Win 10 2004 Logic.psm1.

However, both techniques need refining. I bet that if I familiarize myself with the script, I can make better suggestions. I haven't studied the script thoroughly, since I was introduced to it. I have a life of my own, too, you know.

OneDrive not found and other errors

I did run this script three times, fails with such errors.

Errors
Line Error


1607 Cannot find path 'C:\WINDOWS\Temp' because it does not exist.
1603 Cannot find path 'C:\Users\Username\AppData\Local\Temp' because it does not exist.
1600 Cannot find path 'C:\PerfLogs' because it does not exist.
1062 No MSFT_Printer objects found with property 'Name' equal to 'Microsoft Print to PDF'. Verify the value of the
property and retry.
1062 No MSFT_Printer objects found with property 'Name' equal to 'Microsoft XPS Document Writer'. Verify the value of
the property and retry.
1062 No MSFT_Printer objects found with property 'Name' equal to 'Fax'. Verify the value of the property and retry.
1036 Cannot find path 'D:\Desktop\Microsoft Edge.lnk' because it does not exist.
990 Property NullFile does not exist at path HKEY_CLASSES_ROOT.bmp\ShellNew.
989 Property ItemName does not exist at path HKEY_CLASSES_ROOT.bmp\ShellNew.
986 Property ItemName does not exist at path HKEY_CLASSES_ROOT.rtf\ShellNew.
985 Property Data does not exist at path HKEY_CLASSES_ROOT.rtf\ShellNew.
982 Cannot find path 'HKEY_CLASSES_ROOT.zip\CompressedFolder\ShellNew' because it does not exist.
913 Property Extended does not exist at path HKEY_CLASSES_ROOT\exefile\shell\runasuser.
890 Cannot bind parameter 'Name'. Cannot convert value to type System.String.
799 Cannot find path 'J:\Программы\Прочее' because it does not exist.
799 Cannot find path 'D:\Программы\Прочее' because it does not exist.
594 Cannot find path 'C:\Users\Serik\OneDrive' because it does not exist.
593 Property OneDrive does not exist at path HKEY_CURRENT_USER\Environment.
581 Cannot find a process with the name "OneDrive". Verify the process name and call the cmdlet again.

Script only runs on 64bit system

image

I recently installed 32-bit version Windows 10 2004 when I ran your script it gave me an error that the system isn't supported.

Script Error while creating ProcessCreation.xml

The Script is showing an error (Line 3165 Could not find a part of the path 'C:\ProgramData\Event Viewer\Views\ProcessCreation.xml) on Fresh Windows 10 Pro 2004 install i think the script is trying to create a file in a folder which doesn't exist.

Windows Subsystem for Linux (WSL2) issues

After running the script, WSL2 running Ubuntu 20.04, doesn't seem to be connected to the internet.

Steps to reproduce:

  • Clean Windows Installation (Version 2004, OS Build: 19041.330)
  • Install WSL2 (Enable Windows Features: Windows Subsystem for Linux, Virtual Machine Platform)
  • Install a Distro (Ubuntu 20.04 LTS)
  • Run $ sudo apt-get update
  • Run $ sudo apt-get install build-essential checkinstall
  • Everything should work according to plan

(Issue starting here)

  • Run the latest script
  • Reboot PC.
  • Run $ sudo apt-get update
  • Run $ sudo apt-get install build-essential checkinstall
  • This time, you get the errors attached below.

image
(Figure 1: Running $ sudo apt-get update )

image
(Figure 2: VScode complaining about the same, bottom right corner )

image
(Figure 3: Running $ sudo apt-get install build-essential checkinstall )

Mail and Calendar app not working

I might have missed some part of code, but, Mail and Calendar apps are crashing within seconds after opening.
Need help to revert this feature or function.

дубликат строки

встречается пару раз, выхлоп один ;)

New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338388Enabled -Value 0 -Force

Stuck at Microsoft.549981C3F5F10_8wekyb3d8bbwe\CortanaStartupId' because it does not exist.

Before submitting a bug report:

  • Make sure you are able to repro it on the latest released version;
  • The .ps1 file has UTF-8 with BOM enconding.

Steps to reproduce

Download latest from release for 2004 version and execute with admin prev.

Screenshots
Capture0
Capture

Desktop (please complete the following information):
Version 2004 (OS build 19041.329)

Additional context
Add any other context about the problem here.

**Not sure about below changes: **

  • print hot key replaced with inbuilt tool and my greenshot not working. after restart - realized the new feature is awesome.
  • task bar right side icons auto expanded and there is no hidden items (its ok, but it reduces the space from middle)

WSL Distro gone after running the script

Sorry for posting this. This is a request for help. I did run the Win.10.2004.4.5.6 script following the Youtube video from Chris Titus. Unlike in the video I chose to create a restore point at the start of the script.

After the script was done. I can't find my Ubuntu 18.04 distro anymore. I recovered to the restore point, but wsl still says there are no distros installed. Unfortunately, I created a pretty big repository that I didn't push to Github. (I know this was stupid! I don't know why I don't created this project.) Do you know if I can undo the distro deletion?

Desktop (please complete the following information):

  • Windows build: 19042.423

Changed Default Keyboard Layout in Login Screen

I installed Windows 2004 with german keyboard layout and german language settings.
After running the script with default settings, I had english default keyboard layout in the login screen.

I was able to change it back to german layout, but maybe thats a bug other users could also struggle with.

Desktop (please complete the following information):

  • Windows build: 2004

Backport options

Option to exclude some part of changes does not exists.
For example, right now i am trying to get back new WIn10 Start menu view and Miscrosoft solarite game (don't ask me why :) on several wrokstations in a corporate domain.

Microsoft Edge not removed

ran this script and for the most part, it got rid of all items as described. But left Msft Edge both in the SystemApps folder and in the Start Menu. Please help! Thanks.

Edit: on the 2004 version.

Вопрос по замене $OFS

Добрый день!
Я новичок в powershell и пытаюсь использовать ваш скрипт в своих целях. У меня вопрос есть вопрос по одному из действий в скрипте. Несколько раз перед выполнением некоторых операций разделитель массива строки $OFS меняется с пробела на символ "|", а после выполнения операции меняется обратно на пробел. В частности в той части скрипта на удаление UWP-приложений. Подскажите, пожалуйста, с какой целью это делается? Ведь без этой замены UWP-приложения также удаляются.

(Solved) SnippingTool (20H2)

I ran the test version of of this tool (20H2). It worked great except for one thing. SnippingTool has now taken control of the PrintScreen key. I have used this key with Greenshot. I selected SnippingTool and note tools (not OneNote) to be uninstalled.
I ran the script again. But I still got the same apps for uninstallation. Second time I selected all users. Din't help.

I have tried to disable SnippingTool with both reg. entry and policy entry. It still captures the Print Screen key.

Any suggestions?

Keep up the good work! 👍🏻

PS script failure due to Bitdefender false positive detection for "C:\Windows\System32\Tasks\Setup Script\Windows Cleanup"

My antivirus software (Bitdefender Total Security) gives me a false positive during execution of the Powershell script:

"The file C:\Windows\System32\Tasks\Setup Script\Windows Cleanup is infected with Heur.BZC.WBO.Boxter.501.4B1E4D92. The threat was successfully blocked, your device is safe."

After the Windows task has been aborted, the file "C:\Windows\System32\Tasks\Setup Script\Windows Cleanup" is no longer present (not even quarantined).
Is it possible to save the generated task file otherwise, so that I can request a whitelisting by Bitdefender Support?

Error due to unicode ?

Hello
I'm unable to run your script, i think is due to characters problem ?
See my attatchment
error

Windows build version: 18362.295
Thanks

Making the script more user-friendly: Those cryptic app names

Hello. 😊

Please take a look at this screenshot:
Image

  • Does an ordinary user know what Microsoft.549981C3F5F10 is? What about you? (It's Cortana, by the way.)
  • How about c5e2524a-ea46-4f67-841f-6a9465d9d515? (It is File Explorer.)
  • Or Microsoft.MSPaint. (It is NOT Microsoft Paint. It is Paint 3D.)

I recommend the user should know the friendly name of these apps.

You can find a script called Inventory AppX Packages.ps1 on my repo. It helps you discover the friendly names.

Send to gone after running the script

Steps to reproduce

Just run the latest version of the script (Win.10.1903-1909.4.4.6)

Desktop:

  • Windows build: 18363

Additional context
The send to option from the context menu is gone. I have had the same exact result after running the script on two different devices after a fresh windows install.

I fixed that on both devices by editing a registry entry which had an extra hyphen in its value for some reason.

Update README.md with features list?

Currently this project has a very minimalist and unclear README.md overview and furthermore the comments inside the project files are in Russian, could we arrange a better documentation in English @farag2?

Thanks.

Bad user input behavior

User entered text often doesn't produce the results stated in the prompt. This is at least as bad with current version as from the version 1 week ago.

At 2 or 3 points during script execution the program just stops progressing and no prompt is given. Hitting the space bar nudges the script to continue.

At several points during script execution the prompt will not accept ENTER key until I enter some other key first. Sometimes hitting ENTER multiple times works, but I fear doing that because I don't know if it buffers up the multiple ENTERs to use the for subsequent prompts.

Sometimes prompts won't take any input at all until I refocus on the window (though I did nothing to take focus away from the script execution window).

Sometimes when I re-run it to see if disabled apps have reverted (which happened many times), if I see all of the apps are removed and nothing to do so just close the app-sel UI, the script freezes and there's nothing I can do but close the script window.

Создание функции для переноса пользовательских библиотек

Добрый день! Не могли бы вы оформить перенос библиотек в качестве функции? Просто я заметил, что там код однотипный и функция там так и просится. Плюс ко всему и код станет универсальнее и чище (IMHO). К примеру для себя я переделал так:

CODE
Function KnownFolderPath {
    Param ( [Parameter(Mandatory = $true)]
            [ValidateSet("Desktop", "Documents", "Downloads", "Music", "Pictures", "Videos")]
            [string]$KnownFolder,
            [Parameter(Mandatory = $true)]
            [string]$Path )
    $KnownFolders   = @{"Desktop"   = @("B4BFCC3A-DB2C-424C-B029-7FE99A87C641")
                        "Documents" = @("FDD39AD0-238F-46AF-ADB4-6C85480369C7", "f42ee2d3-909f-4907-8871-4c22fc0bf756")
                        "Downloads" = @("374DE290-123F-4565-9164-39C4925E467B", "7d83ee9b-2244-4e70-b1f5-5393042af1e4")
                        "Music"     = @("4BD8D571-6D19-48D3-BE97-422220080E43", "a0c69a99-21c8-4671-8703-7934162fcf1d")
                        "Pictures"  = @("33E28130-4E1E-4676-835A-98395C3BC3BB", "0ddd015d-b06c-45d5-8c4c-f59713854639")
                        "Videos"    = @("18989B1D-99B5-455B-841C-AB7C74E4DDFC", "35286a68-3c57-41a1-bbb1-0eae73d76c95")}
    $Signature  = @{Namespace        = "WinAPI"
                    Name             = "KnownFolders"
                    Language         = "CSharp"
                    MemberDefinition = @"
[DllImport("shell32.dll")]
public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, IntPtr token, [MarshalAs(UnmanagedType.LPWStr)] string path);
"@}
    if (-not ("WinAPI.KnownFolders" -as [type])) {Add-Type @Signature}
    $KnownFolders[$KnownFolder] | %{[WinAPI.KnownFolders]::SHSetKnownFolderPath([ref]$_, 0, 0, $Path)}
    (Get-Item -Path $Path -Force ).Attributes = "ReadOnly"
}  
function Set-UserLibrary {
    param (
        [Parameter(Mandatory = $true)]
        [string]$Path,
        [Parameter(Mandatory = $true)]
        [string]$LibraryName
    )
    $LibraryFolder = "$($Path -Replace('/+', '\') -Replace('\\\\+', '\') -Replace('\\*$', ''))\$LibraryName"
    if ($Script:Drives.Contains($LibraryFolder.Substring(0,3).ToUpper())) {
        $Reg = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name $LibraryINI.$LibraryName[0][0]
        if ($Reg -ne $LibraryFolder) {
            if (-not (Test-Path -Path $LibraryFolder)) {New-Item -Path $LibraryFolder -ItemType Directory -Force}
            KnownFolderPath -KnownFolder $LibraryName -Path $LibraryFolder
            New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name $LibraryINI.$LibraryName[0][1] -PropertyType ExpandString -Value $LibraryFolder -Force
            Set-Content -Path "$LibraryFolder\desktop.ini" -Value $LibraryINI.$LibraryName[1] -Encoding Unicode -Force
            (Get-Item -Path "$LibraryFolder\desktop.ini" -Force).Attributes = "Hidden", "System", "Archive"
            (Get-Item -Path "$LibraryFolder\desktop.ini" -Force).Refresh()
        }
    }
}  
[hashtable] $LibraryINI = @{
    "Desktop"    =  @("Desktop", "{754AC886-DF64-4CBA-86B5-F7FBF4FBCEF5}"),
                    @("", "[.ShellClassInfo]", "LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21769",
                    "IconResource=%SystemRoot%\system32\imageres.dll,-183")
    "Documents"  =  @("Personal", "{F42EE2D3-909F-4907-8871-4C22FC0BF756}"),
                    @("", "[.ShellClassInfo]", "LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21770",
                    "IconResource=%SystemRoot%\system32\imageres.dll,-112",
                    "IconFile=%SystemRoot%\system32\shell32.dll", "IconIndex=-235")
    "Downloads"  =  @("{374DE290-123F-4565-9164-39C4925E467B}", "{7D83EE9B-2244-4E70-B1F5-5393042AF1E4}"),
                    @("", "[.ShellClassInfo]","LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21798",
                    "IconResource=%SystemRoot%\system32\imageres.dll,-184")
    "Music"      =  @("My Music", "{A0C69A99-21C8-4671-8703-7934162FCF1D}"),
                    @("", "[.ShellClassInfo]","LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21790",
                    "InfoTip=@%SystemRoot%\system32\shell32.dll,-12689",
                    "IconResource=%SystemRoot%\system32\imageres.dll,-108",
                    "IconFile=%SystemRoot%\system32\shell32.dll", "IconIndex=-237")
    "Pictures"   =  @("My Pictures", "{0DDD015D-B06C-45D5-8C4C-F59713854639}"),
                    @("", "[.ShellClassInfo]", "LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21779",
                    "InfoTip=@%SystemRoot%\system32\shell32.dll,-12688",
                    "IconResource=%SystemRoot%\system32\imageres.dll,-113",
                    "IconFile=%SystemRoot%\system32\shell32.dll", "IconIndex=-236")
    "Videos"     =  @("My Video", "{35286A68-3C57-41A1-BBB1-0EAE73D76C95}"),
                    @("", "[.ShellClassInfo]", "LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21791",
                    "InfoTip=@%SystemRoot%\system32\shell32.dll,-12690",
                    "IconResource=%SystemRoot%\system32\imageres.dll,-189",
                    "IconFile=%SystemRoot%\system32\shell32.dll", "IconIndex=-238")
}  
$Drives = (Get-Disk | Where-Object -FilterScript {$_.BusType -ne "USB"} | Get-Partition | Get-Volume).DriveLetter | Sort-Object -Unique | ?{$_.Length -gt 0 } | %{"$($_):\"}
Write-Host "Ваши диски: " -NoNewline
Write-Host "$($Drives -join ', ')" -ForegroundColor Yellow
Write-Host "`nВведите путь, по которому будут перенесены такие библиотеки пользователя, как:" -NoNewline
Write-Host "`n`"Рабочий стол`", `"Документы`", `"Загрузки`", `"Музыка`", `"Изображения`", `"Видео`"." -ForegroundColor Yellow
Write-Host "`nЧтобы пропустить, нажмите Enter."
$LibraryPath = Read-Host -Prompt "Введите путь"
if ($LibraryPath) {
    $LibraryINI.Keys | %{Set-UserLibrary -Path $LibraryPath -LibraryName $_}
    $edge = (Get-AppxPackage "Microsoft.MicrosoftEdge").PackageFamilyName
    New-ItemProperty -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\$edge\MicrosoftEdge\Main" -Name "Default Download Directory" -PropertyType String -Value "$LibraryPath\Downloads" -Force
}

Pc freezes after a bit while watching streaming\playing game

Before submitting a bug report:

  • Make sure you are able to repro it on the latest released version;
  • The .ps1 file has UTF-8 with BOM enconding.

Steps to reproduce
After i run latest Win.10.2004.4.5.3.zip on my latest windows 10 2004 version. Everytime i watch streaming or gaming online my pc freezes and nothing can be done. Even the keyboard is stuck, the whole system is stuck and the only way is the reset button.
I'm pretty sure it's the script because when i go to previous created restore point,computer smooth like ever before running the script.
Also another important thing: Browsing the pages and overall internet is very slow\sluggish as it's not after restore point is done.
How can i solve without using restore point since i want all the bloatwares and telemetry away?
Thanks in advance

bvVGlNa 1

Screenshots
If applicable, add screenshots to help explain your problem.
https://i.imgur.com/bvVGlNa.png

Desktop (please complete the following information):

  • Windows build: See screenshot link above

Additional context
Add any other context about the problem here.

Скрипт не запускается

В связи с тем, что скрипт не подписан сертификатом, он просто не отработает. Более того - из батника пришлось убирать -remotesigned.
Если предполагается отключение политик или выполнять другие действия для работы, то следует написать об этом в Readme.

Add Windows calculator to the list of excluded applications and add functionality delete user folders from this computer

Hello! It would be nice to leave the calculator out of UWP apps. And delete user folders from this computer because they are duplicated in quick access.

These folders
I mean these folders.

You could just explain how to do it so I can add it to the fork. You don't have to add this to a new release.

So I have the code that can hide these folders. But that code for Windows register.

Code
Windows Registry Editor Version 5.00
;Удаление 7 папок пользователя из окна компьютер
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag]
"ThisPCPolicy"="Hide"

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag]
"ThisPCPolicy"="Hide"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag]
"ThisPCPolicy"="Hide"

[-HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]

Thanks in advance.

Strange things...

I used your script and strange things are happening here.

  1. Windows Wallet on startup - why? x1
    image

  2. Seconds on timer - why? x2
    image

  3. Windows sandbox install - why? x3
    image

  4. ribbon view on default - why? x4
    image

  5. Powershell folder in documents - okey let's skip

image

it's only a few minutes after the reboot, so there could be more. 🙉

Script version:

image

OS informations:

image

Ошибки после запуска скрипта.

Hi, during script running, I faced this errors.
C:\Users\vissay\Desktop\Windows-10-Setup-Script-4.0.4\Win10.ps1:1645 знак:31

  •     $apps = Read-Host -Prompt " "
    
  •                                 ~
    

Непредвиденная лексема ""
IF ($apps -match "" в выражении или операторе.
C:\Users\vissay\Desktop\Windows-10-Setup-Script-4.0.4\Win10.ps1:1646 знак:25

  •     IF ($apps -match ".exe" -and $apps -match "`"")
    
  •                           ~~~~~~~~~~~~~~~~~~~~~
    

Непредвиденная лексема "" -and $apps -match "" в выражении или операторе.
C:\Users\vissay\Desktop\Windows-10-Setup-Script-4.0.4\Win10.ps1:1646 знак:46

  •     IF ($apps -match ".exe" -and $apps -match "`"")
    
  •                                                ~~~~
    

Непредвиденная лексема """) { GpuPreference $apps } elseif ([string]::IsNullOrEmpty($apps)) { break } else { IF ($RU) { Write-Host "nПути РЅРµ взяты" в выражении или операторе.
C:\Users\vissay\Desktop\Windows-10-Setup-Script-4.0.4\Win10.ps1:1687 знак:2

  • {
    
  • ~
    

Отсутствует закрывающий знак "}" в блоке операторов или определении типа.
C:\Users\vissay\Desktop\Windows-10-Setup-Script-4.0.4\Win10.ps1:1685 знак:1

  • {
  • ~
    Отсутствует закрывающий знак "}" в блоке операторов или определении типа.
    C:\Users\vissay\Desktop\Windows-10-Setup-Script-4.0.4\Win10.ps1:1491 знак:1
  • {
  • ~
    Отсутствует закрывающий знак "}" в блоке операторов или определении типа.
    C:\Users\vissay\Desktop\Windows-10-Setup-Script-4.0.4\Win10.ps1:1694 знак:56
  • ... IF ((Get-CimInstance –ClassName CIM_ComputerSystem).Hyperv ...
  •                                                              ~
    

Отсутствует ключевое слово while или until в цикле do.
C:\Users\vissay\Desktop\Windows-10-Setup-Script-4.0.4\Win10.ps1:747 знак:1

  • {
  • ~
    Отсутствует закрывающий знак "}" в блоке операторов или определении типа.
    C:\Users\vissay\Desktop\Windows-10-Setup-Script-4.0.4\Win10.ps1:1694 знак:56
  • ... IF ((Get-CimInstance –ClassName CIM_ComputerSystem).Hypervi ...
  •                                                             ~
    

Непредвиденная лексема ")" в выражении или операторе.
C:\Users\vissay\Desktop\Windows-10-Setup-Script-4.0.4\Win10.ps1:1694 знак:85

  • ... nstance –ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
  •                                                                     ~
    

Непредвиденная лексема ")" в выражении или операторе.
Выданы сообщения не обо всех ошибках синтаксического анализа. Исправьте перечисленные в сообщениях ошибки и повторите попытку.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken

Черный экран

День добрый,
После применения скрипта (без ошибок).

При перезагрузке, после ввода пароля , черный экран, мин 5-7 (при этом ПК работает и через кон+шифт+еск запускается диспетчер задач и приложения через него).
Потом появляется заставка и меню пуск.

https://ibb.co/CvqW5cg

Такая проблема на всех ПК, где применялся скрипт шт 5.
10 -1903.

Профили

Неплохо было бы разделить настройки компьютера и пользователя, чтобы настраивать отдельно.

desktop ruined

So my desktop is now showing the users/Public desktop?? How can I revert this to the old desktop for MY account which is location in users/callu/OneDrive/Desktop

No MS Store connection after running the script

Before submitting a bug report:

  • Make sure you are able to repro it on the latest released version;
  • The .ps1 file has UTF-8 with BOM enconding.

Steps to reproduce
As asked, in below link there are issue and resolution.

Screenshots
H0WBrOT 1

Desktop (please complete the following information):

  • Windows build: above screenshot

Additional context
problem here.

Ps4 remote play breaks even after restoring to a previous point

I ran into this issue first when I used the debloater for 1909, but I didn't create a restore point.
Reïnstalling ps4 remote play also didn't work, I couldn't even reïnstall it at first because I had to re-enable media pack features and install and setup windows media player. But after doing that and reïnstalling ps4 remote play I get the error "cannot connect to server".

I updated to windows 2004 and It started working again. Ran the debloater and made sure media pack wasn't disabled and made a restore point. After the debloater ran the same problem occurs "can't connect to server".
So I decided to return to the restore point so I could pin down what service or process was the problem, but I still get the error after restoring.

Right now I can't get the ps4 remote play programm to open. It gets stuck on the error.
ps4RmtPlatPNG

Virtual printer is gone.

Hello, I need help. My virtual printer is gone. Can you tell me which key I modified that caused this consequence? Is there a way to revert?

I use the foxitreader's virtual printer and it's gone. I tried to reinstall and the option to install a virtual printer does not appear.
foxireader_novirtualprinter

I used the version published shortly after 7/15/2020
winver

http://cdn01.foxitsoftware.com/pub/foxit/manual/reader/en_us/FoxitReader9.3_Manual.pdf
Follow print and the link to the foxitreader manual and the print of my installation attempt.
foxireader_yesvirtualprinter

I am a common user and I found your work the best of all that I have seen in this context. I encourage you to continue this work for as long as you can, it really is an excellent job!

Error during script's work + feature request

Here is screenshots with several errors, maybe some of them are OK (especially warning about network connection - virtual machine does not have it, I just installed Windows 10 Pro 1909).
And what i should choose at screenshot №4?
Windows 10.zip

Feature request - make changing Desktop, Documents and other userfolders optional and skippable - I usually doint it by myself, and solution in script not understandable for me at all - Why script moving them to root of harddrive (not folder choosed by user), why user should move his files by own, what happens with current files - I don't see Users folder in C Drive?

Kaspersky

  • Win.10.2004.4.5.4

when starting the script , Kaspersky sees it as a virus and remove it .

Taskmgr

Когда скрипт доходит до следующего кода, который запускает диспетчер задач, падает ошибка
photo_2019-12-24_14-51-14

Но как только я открываю диспетчер задач с помощью ctrl+shift+esc, скрипт продолжает работу.

Help about updating

Hey dude sorry, i can't find where to contact you
I just have a question, should i be updating the script on my PC as you have new releases?

Thanks

Error after run (win10 x64 insider)

PS Z:> .\win10.ps1
Z:\win10.ps1:726 знак:2

  • {
    
  • ~
    

Отсутствует закрывающий знак "}" в блоке операторов или определении типа.
Z:\win10.ps1:724 знак:1

  • {
  • ~
    Отсутствует закрывающий знак "}" в блоке операторов или определении типа.
    Z:\win10.ps1:733 знак:56
  • ... IF ((Get-CimInstance –ClassName CIM_ComputerSystem).Hypervi ...
  •                                                             ~
    

Непредвиденная лексема ")" в выражении или операторе.
Z:\win10.ps1:733 знак:85

  • ... nstance –ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
  •                                                                     ~
    

Непредвиденная лексема ")" в выражении или операторе.
Z:\win10.ps1:890 знак:2

  • }
    
  • ~
    

Непредвиденная лексема "}" в выражении или операторе.
Z:\win10.ps1:891 знак:1

  • }
  • ~
    Непредвиденная лексема "}" в выражении или операторе.
    Z:\win10.ps1:949 знак:2
  • }
    
  • ~
    

Непредвиденная лексема "}" в выражении или операторе.
Z:\win10.ps1:950 знак:1

  • }
  • ~
    Непредвиденная лексема "}" в выражении или операторе.
    Z:\win10.ps1:1347 знак:77
  • ... = "Файлы реестра (.reg)|.reg|Р’СЃРµ файлы (.)|* ...
  •                                                      ~~~~~~~~
    

Непредвиденная лексема "айлы" в выражении или операторе.
Z:\win10.ps1:1816 знак:193

  • ... /c DISM /Online /Add-Package /PackagePath:"%1" /NoRestart & pause" ...
  •                                                             ~
    

Амперсанд (&) не разрешен. Оператор & зарезервирован для будущих версий. Добавьте двойные кавычки до и после амперсанда ("&"), чтобы передать его как строку.
Выданы сообщения не обо всех ошибках синтаксического анализа. Исправьте перечисленные в сообщениях ошибки и повторите попытку.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : MissingEndCurlyBrace

Revert tray icon changes

How can I rever the tray icon to its previous state? Now all of the icons are shown, which I do not like
image

I managed to bring my search bar in the toolbar back, but I could not fix tray icon.

In my opinion, this script should give an option for skipping all the UI changes!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.