mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-12-29 01:11:30 -06:00
Compare commits
9 Commits
3f933cecc0
...
582898fa4a
Author | SHA1 | Date | |
---|---|---|---|
|
582898fa4a | ||
|
ce1ef2a519 | ||
|
77cb0a14c4 | ||
|
c254a43f77 | ||
|
640d2ca107 | ||
|
c186642998 | ||
|
47a4f1547e | ||
|
1caf3111d3 | ||
|
7dcdc4dbb7 |
@ -52,7 +52,7 @@ If you have Issues, refer to [Known Issues](https://christitustech.github.io/win
|
|||||||
|
|
||||||
These are the sponsors that help keep this project alive with monthly contributions.
|
These are the sponsors that help keep this project alive with monthly contributions.
|
||||||
|
|
||||||
<!-- sponsors --><a href="https://github.com/ysaito8015"><img src="https://avatars.githubusercontent.com/u/3502978?u=ca98bf67f04d67080df0feeaa6f007fad51d273f&v=4" width="60px" alt="Yusuke Saito" /></a><a href="https://github.com/TriHydera"><img src="https://avatars.githubusercontent.com/u/39857764?u=5dbda638f45530582eee1703b4473f2a5e229e28&v=4" width="60px" alt="TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://avatars.githubusercontent.com/u/3272468?u=4391ed4655e4fd8b56e23b4169e44e2ac9b6cd97&v=4" width="60px" alt="" /></a><a href="https://github.com/DelDongo"><img src="https://avatars.githubusercontent.com/u/127976398?v=4" width="60px" alt="" /></a><a href="https://github.com/markamos"><img src="https://avatars.githubusercontent.com/u/9561861?u=3cca179dcff0413538591e57a3abea116d65ce56&v=4" width="60px" alt="Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://avatars.githubusercontent.com/u/54533224?u=a49ea000a8f52adb31382ea69a1a7501b27fefdd&v=4" width="60px" alt="" /></a><a href="https://github.com/mews-se"><img src="https://avatars.githubusercontent.com/u/58894405?v=4" width="60px" alt="" /></a><a href="https://github.com/jdiegmueller"><img src="https://avatars.githubusercontent.com/u/18660571?u=601d0a23040a271c86b5d40339f899a6dbf27086&v=4" width="60px" alt="Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https://avatars.githubusercontent.com/u/105566568?v=4" width="60px" alt="" /></a><a href="https://github.com/zepled112"><img src="https://avatars.githubusercontent.com/u/65176625?v=4" width="60px" alt="wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https://avatars.githubusercontent.com/u/105917451?u=ee73ff639c7bd9feb4708ab4ba7b14eff80196f7&v=4" width="60px" alt="" /></a><a href="https://github.com/robertsandrock"><img src="https://avatars.githubusercontent.com/u/12015331?v=4" width="60px" alt="RMS" /></a><a href="https://github.com/mmomega"><img src="https://avatars.githubusercontent.com/u/71956566?v=4" width="60px" alt="" /></a><a href="https://github.com/KenichiQaz"><img src="https://avatars.githubusercontent.com/u/31177857?u=efdbae734a4c60a7bb95df4659d0535e60a6fd57&v=4" width="60px" alt="Stefan" /></a><a href="https://github.com/paulsheets"><img src="https://avatars.githubusercontent.com/u/45240946?u=d4db66f8e8d7a2606fe7a5521daf48ca9f097105&v=4" width="60px" alt="Paul" /></a><a href="https://github.com/djones369"><img src="https://avatars.githubusercontent.com/u/4107092?v=4" width="60px" alt="Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://avatars.githubusercontent.com/u/19240897?u=f82b4be098cac65c8421421b70ebd2d1da85c67e&v=4" width="60px" alt="Anthony Mendez" /></a><a href="https://github.com/xBandaku"><img src="https://avatars.githubusercontent.com/u/142067112?u=0c9a1edee45ac2a0a42827d418a12b1791d52350&v=4" width="60px" alt="xPandaku" /></a><a href="https://github.com/claudemods"><img src="https://avatars.githubusercontent.com/u/73653396?u=d64c656fb8db24ef56bb000197532df9b618d06c&v=4" width="60px" alt="Claudemods" /></a><a href="https://github.com/FatBastard0"><img src="https://avatars.githubusercontent.com/u/173957728?v=4" width="60px" alt="" /></a><a href="https://github.com/tcookj66"><img src="https://avatars.githubusercontent.com/u/61920813?v=4" width="60px" alt="Timothy Cook" /></a><a href="https://github.com/Ascent7910"><img src="https://avatars.githubusercontent.com/u/118260621?v=4" width="60px" alt="Max" /></a><a href="https://github.com/DursleyGuy"><img src="https://avatars.githubusercontent.com/u/140165544?v=4" width="60px" alt="DursleyGuy" /></a><a href="https://github.com/YamiSandman616"><img src="https://avatars.githubusercontent.com/u/183505690?u=c3bd20157058b6215e28f7568d4f8c4fbbe92838&v=4" width="60px" alt="Sandman616" /></a><a href="https://github.com/Lineax17"><img src="https://avatars.githubusercontent.com/u/144595200?u=a2fcdfbfeae6749396c3483e108612f65afb393d&v=4" width="60px" alt="" /></a><!-- sponsors -->
|
<!-- sponsors --><a href="https://github.com/ysaito8015"><img src="https://avatars.githubusercontent.com/u/3502978?u=ca98bf67f04d67080df0feeaa6f007fad51d273f&v=4" width="60px" alt="Yusuke Saito" /></a><a href="https://github.com/TriHydera"><img src="https://avatars.githubusercontent.com/u/39857764?u=5dbda638f45530582eee1703b4473f2a5e229e28&v=4" width="60px" alt="TriHydera" /></a><a href="https://github.com/jozozovko"><img src="https://avatars.githubusercontent.com/u/3272468?u=4391ed4655e4fd8b56e23b4169e44e2ac9b6cd97&v=4" width="60px" alt="" /></a><a href="https://github.com/DelDongo"><img src="https://avatars.githubusercontent.com/u/127976398?v=4" width="60px" alt="" /></a><a href="https://github.com/markamos"><img src="https://avatars.githubusercontent.com/u/9561861?u=3cca179dcff0413538591e57a3abea116d65ce56&v=4" width="60px" alt="Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://avatars.githubusercontent.com/u/54533224?u=a49ea000a8f52adb31382ea69a1a7501b27fefdd&v=4" width="60px" alt="" /></a><a href="https://github.com/mews-se"><img src="https://avatars.githubusercontent.com/u/58894405?v=4" width="60px" alt="" /></a><a href="https://github.com/jdiegmueller"><img src="https://avatars.githubusercontent.com/u/18660571?u=601d0a23040a271c86b5d40339f899a6dbf27086&v=4" width="60px" alt="Jason A. Diegmueller" /></a><a href="https://github.com/AlanTristar"><img src="https://avatars.githubusercontent.com/u/105566568?v=4" width="60px" alt="" /></a><a href="https://github.com/zepled112"><img src="https://avatars.githubusercontent.com/u/65176625?v=4" width="60px" alt="wyatt" /></a><a href="https://github.com/altugtekiner"><img src="https://avatars.githubusercontent.com/u/105917451?u=ee73ff639c7bd9feb4708ab4ba7b14eff80196f7&v=4" width="60px" alt="" /></a><a href="https://github.com/robertsandrock"><img src="https://avatars.githubusercontent.com/u/12015331?v=4" width="60px" alt="RMS" /></a><a href="https://github.com/mmomega"><img src="https://avatars.githubusercontent.com/u/71956566?v=4" width="60px" alt="" /></a><a href="https://github.com/KenichiQaz"><img src="https://avatars.githubusercontent.com/u/31177857?u=efdbae734a4c60a7bb95df4659d0535e60a6fd57&v=4" width="60px" alt="Stefan" /></a><a href="https://github.com/paulsheets"><img src="https://avatars.githubusercontent.com/u/45240946?u=d4db66f8e8d7a2606fe7a5521daf48ca9f097105&v=4" width="60px" alt="Paul" /></a><a href="https://github.com/djones369"><img src="https://avatars.githubusercontent.com/u/4107092?v=4" width="60px" alt="Dave Jones" /></a><a href="https://github.com/anthonymendez"><img src="https://avatars.githubusercontent.com/u/19240897?u=f82b4be098cac65c8421421b70ebd2d1da85c67e&v=4" width="60px" alt="Anthony Mendez" /></a><a href="https://github.com/xBandaku"><img src="https://avatars.githubusercontent.com/u/142067112?u=0c9a1edee45ac2a0a42827d418a12b1791d52350&v=4" width="60px" alt="xPandaku" /></a><a href="https://github.com/claudemods"><img src="https://avatars.githubusercontent.com/u/73653396?u=d64c656fb8db24ef56bb000197532df9b618d06c&v=4" width="60px" alt="Claudemods" /></a><a href="https://github.com/FatBastard0"><img src="https://avatars.githubusercontent.com/u/173957728?v=4" width="60px" alt="" /></a><a href="https://github.com/Ascent7910"><img src="https://avatars.githubusercontent.com/u/118260621?v=4" width="60px" alt="Max" /></a><a href="https://github.com/DursleyGuy"><img src="https://avatars.githubusercontent.com/u/140165544?v=4" width="60px" alt="DursleyGuy" /></a><a href="https://github.com/YamiSandman616"><img src="https://avatars.githubusercontent.com/u/183505690?u=c3bd20157058b6215e28f7568d4f8c4fbbe92838&v=4" width="60px" alt="Sandman616" /></a><a href="https://github.com/realmuddy"><img src="https://avatars.githubusercontent.com/u/30978236?v=4" width="60px" alt="Phillip Waters" /></a><!-- sponsors -->
|
||||||
|
|
||||||
## 🏅 Thanks to all Contributors
|
## 🏅 Thanks to all Contributors
|
||||||
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.
|
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.
|
||||||
|
@ -3464,14 +3464,5 @@
|
|||||||
"Type": "Button",
|
"Type": "Button",
|
||||||
"ButtonWidth": "300",
|
"ButtonWidth": "300",
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Performance-Plans/RemoveUltPerf"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Performance-Plans/RemoveUltPerf"
|
||||||
},
|
|
||||||
"WPFWinUtilShortcut": {
|
|
||||||
"Content": "Create WinUtil Shortcut",
|
|
||||||
"category": "Shortcuts",
|
|
||||||
"panel": "2",
|
|
||||||
"Order": "a082_",
|
|
||||||
"Type": "Button",
|
|
||||||
"ButtonWidth": "300",
|
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Shortcuts/Shortcut"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ Disables MS Recall built into Windows since 24H2.
|
|||||||
"InvokeScript": [
|
"InvokeScript": [
|
||||||
"
|
"
|
||||||
Write-Host \"Disable Recall\"
|
Write-Host \"Disable Recall\"
|
||||||
DISM /Online /Disable-Feature /FeatureName:Recall
|
DISM /Online /Disable-Feature /FeatureName:Recall
|
||||||
"
|
"
|
||||||
],
|
],
|
||||||
"UndoScript": [
|
"UndoScript": [
|
||||||
@ -45,7 +45,7 @@ Disables MS Recall built into Windows since 24H2.
|
|||||||
DISM /Online /Enable-Feature /FeatureName:Recall
|
DISM /Online /Enable-Feature /FeatureName:Recall
|
||||||
"
|
"
|
||||||
],
|
],
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/DisableRecall"
|
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/DisableRecall"
|
||||||
},
|
},
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ Disables MS Recall built into Windows since 24H2.
|
|||||||
```powershell
|
```powershell
|
||||||
|
|
||||||
Write-Host "Disable Recall"
|
Write-Host "Disable Recall"
|
||||||
DISM /Online /Disable-Feature /FeatureName:Recall
|
DISM /Online /Disable-Feature /FeatureName:Recall
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -1,113 +0,0 @@
|
|||||||
# Create WinUtil Shortcut
|
|
||||||
|
|
||||||
Last Updated: 2024-08-07
|
|
||||||
|
|
||||||
|
|
||||||
!!! info
|
|
||||||
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
|
||||||
|
|
||||||
|
|
||||||
<!-- BEGIN CUSTOM CONTENT -->
|
|
||||||
|
|
||||||
<!-- END CUSTOM CONTENT -->
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Preview Code</summary>
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"Content": "Create WinUtil Shortcut",
|
|
||||||
"category": "Shortcuts",
|
|
||||||
"panel": "2",
|
|
||||||
"Order": "a082_",
|
|
||||||
"Type": "Button",
|
|
||||||
"ButtonWidth": "300",
|
|
||||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Shortcuts/Shortcut"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## Function: Invoke-WPFShortcut
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
function Invoke-WPFShortcut {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Creates a shortcut and prompts for a save location
|
|
||||||
|
|
||||||
.PARAMETER ShortcutToAdd
|
|
||||||
The name of the shortcut to add
|
|
||||||
|
|
||||||
.PARAMETER RunAsAdmin
|
|
||||||
A boolean value to make 'Run as administrator' property on (true) or off (false), defaults to off
|
|
||||||
|
|
||||||
#>
|
|
||||||
param(
|
|
||||||
$ShortcutToAdd,
|
|
||||||
[bool]$RunAsAdmin = $false
|
|
||||||
)
|
|
||||||
|
|
||||||
# Preper the Shortcut Fields and add an a Custom Icon if it's available, else don't add a Custom Icon.
|
|
||||||
|
|
||||||
Switch ($ShortcutToAdd) {
|
|
||||||
"WinUtil" {
|
|
||||||
# Use Powershell 7 if installed and fallback to PS5 if not
|
|
||||||
if (Get-Command "pwsh" -ErrorAction SilentlyContinue) {
|
|
||||||
$shell = "pwsh.exe"
|
|
||||||
} else {
|
|
||||||
$shell = "powershell.exe"
|
|
||||||
}
|
|
||||||
|
|
||||||
$shellArgs = "-ExecutionPolicy Bypass -Command `"Start-Process $shell -verb runas -ArgumentList `'-Command `"irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1 | iex`"`'"
|
|
||||||
|
|
||||||
$DestinationName = "WinUtil.lnk"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Show a File Dialog Browser, to let the User choose the Name and Location of where to save the Shortcut
|
|
||||||
$FileBrowser = New-Object System.Windows.Forms.SaveFileDialog
|
|
||||||
$FileBrowser.InitialDirectory = [Environment]::GetFolderPath('Desktop')
|
|
||||||
$FileBrowser.Filter = "Shortcut Files (*.lnk)|*.lnk"
|
|
||||||
$FileBrowser.FileName = $DestinationName
|
|
||||||
|
|
||||||
# Do an Early Return if the Save Operation was canceled by User's Input.
|
|
||||||
$FileBrowserResult = $FileBrowser.ShowDialog()
|
|
||||||
$DialogResultEnum = New-Object System.Windows.Forms.DialogResult
|
|
||||||
if (-not ($FileBrowserResult -eq $DialogResultEnum::OK)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
# Prepare the Shortcut paramter
|
|
||||||
$WshShell = New-Object -comObject WScript.Shell
|
|
||||||
$Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName)
|
|
||||||
$Shortcut.TargetPath = $shell
|
|
||||||
$Shortcut.Arguments = $shellArgs
|
|
||||||
if (Test-Path -Path $winutildir["logo.ico"]) {
|
|
||||||
$shortcut.IconLocation = $winutildir["logo.ico"]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Save the Shortcut to disk
|
|
||||||
$Shortcut.Save()
|
|
||||||
|
|
||||||
if ($RunAsAdmin -eq $true) {
|
|
||||||
$bytes = [System.IO.File]::ReadAllBytes($FileBrowser.FileName)
|
|
||||||
# Set byte value at position 0x15 in hex, or 21 in decimal, from the value 0x00 to 0x20 in hex
|
|
||||||
$bytes[0x15] = $bytes[0x15] -bor 0x20
|
|
||||||
[System.IO.File]::WriteAllBytes($FileBrowser.FileName, $bytes)
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Shortcut for $ShortcutToAdd has been saved to $($FileBrowser.FileName) with 'Run as administrator' set to $RunAsAdmin"
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
<!-- BEGIN SECOND CUSTOM CONTENT -->
|
|
||||||
|
|
||||||
<!-- END SECOND CUSTOM CONTENT -->
|
|
||||||
|
|
||||||
|
|
||||||
[View the JSON file](https://github.com/ChrisTitusTech/winutil/tree/main/config/tweaks.json)
|
|
||||||
|
|
@ -52,41 +52,6 @@ function Microwin-NewFirstRun {
|
|||||||
Remove-Item -Path "$env:USERPROFILE\Desktop\*.lnk"
|
Remove-Item -Path "$env:USERPROFILE\Desktop\*.lnk"
|
||||||
Remove-Item -Path "$env:HOMEDRIVE\Users\Default\Desktop\*.lnk"
|
Remove-Item -Path "$env:HOMEDRIVE\Users\Default\Desktop\*.lnk"
|
||||||
|
|
||||||
# ************************************************
|
|
||||||
# Create WinUtil shortcut on the desktop
|
|
||||||
#
|
|
||||||
$desktopPath = "$($env:USERPROFILE)\Desktop"
|
|
||||||
# Specify the target PowerShell command
|
|
||||||
$command = "powershell.exe -NoProfile -ExecutionPolicy Bypass -Command 'irm https://christitus.com/win | iex'"
|
|
||||||
# Specify the path for the shortcut
|
|
||||||
$shortcutPath = Join-Path $desktopPath 'winutil.lnk'
|
|
||||||
# Create a shell object
|
|
||||||
$shell = New-Object -ComObject WScript.Shell
|
|
||||||
|
|
||||||
# Create a shortcut object
|
|
||||||
$shortcut = $shell.CreateShortcut($shortcutPath)
|
|
||||||
|
|
||||||
if (Test-Path -Path "$env:HOMEDRIVE\Windows\cttlogo.png") {
|
|
||||||
$shortcut.IconLocation = "$env:HOMEDRIVE\Windows\cttlogo.png"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Set properties of the shortcut
|
|
||||||
$shortcut.TargetPath = "powershell.exe"
|
|
||||||
$shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -Command `"$command`""
|
|
||||||
# Save the shortcut
|
|
||||||
$shortcut.Save()
|
|
||||||
|
|
||||||
# Make the shortcut have 'Run as administrator' property on
|
|
||||||
$bytes = [System.IO.File]::ReadAllBytes($shortcutPath)
|
|
||||||
# Set byte value at position 0x15 in hex, or 21 in decimal, from the value 0x00 to 0x20 in hex
|
|
||||||
$bytes[0x15] = $bytes[0x15] -bor 0x20
|
|
||||||
[System.IO.File]::WriteAllBytes($shortcutPath, $bytes)
|
|
||||||
|
|
||||||
Write-Host "Shortcut created at: $shortcutPath"
|
|
||||||
#
|
|
||||||
# Done create WinUtil shortcut on the desktop
|
|
||||||
# ************************************************
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ((Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -like "Recall" }).Count -gt 0)
|
if ((Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -like "Recall" }).Count -gt 0)
|
||||||
|
@ -50,7 +50,6 @@ function Invoke-WPFButton {
|
|||||||
"WPFFixesNetwork" {Invoke-WPFFixesNetwork}
|
"WPFFixesNetwork" {Invoke-WPFFixesNetwork}
|
||||||
"WPFUpdatesdisable" {Invoke-WPFUpdatesdisable}
|
"WPFUpdatesdisable" {Invoke-WPFUpdatesdisable}
|
||||||
"WPFUpdatessecurity" {Invoke-WPFUpdatessecurity}
|
"WPFUpdatessecurity" {Invoke-WPFUpdatessecurity}
|
||||||
"WPFWinUtilShortcut" {Invoke-WPFShortcut -ShortcutToAdd "WinUtil" -RunAsAdmin $true}
|
|
||||||
"WPFGetInstalled" {Invoke-WPFGetInstalled -CheckBox "winget"}
|
"WPFGetInstalled" {Invoke-WPFGetInstalled -CheckBox "winget"}
|
||||||
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
|
"WPFGetInstalledTweaks" {Invoke-WPFGetInstalled -CheckBox "tweaks"}
|
||||||
"WPFGetIso" {Invoke-MicrowinGetIso}
|
"WPFGetIso" {Invoke-MicrowinGetIso}
|
||||||
|
@ -1,72 +0,0 @@
|
|||||||
function Invoke-WPFShortcut {
|
|
||||||
<#
|
|
||||||
|
|
||||||
.SYNOPSIS
|
|
||||||
Creates a shortcut and prompts for a save location
|
|
||||||
|
|
||||||
.PARAMETER ShortcutToAdd
|
|
||||||
The name of the shortcut to add
|
|
||||||
|
|
||||||
.PARAMETER RunAsAdmin
|
|
||||||
A boolean value to make 'Run as administrator' property on (true) or off (false), defaults to off
|
|
||||||
|
|
||||||
#>
|
|
||||||
param(
|
|
||||||
$ShortcutToAdd,
|
|
||||||
[bool]$RunAsAdmin = $false
|
|
||||||
)
|
|
||||||
|
|
||||||
# Preper the Shortcut Fields and add an a Custom Icon if it's available, else don't add a Custom Icon.
|
|
||||||
|
|
||||||
Switch ($ShortcutToAdd) {
|
|
||||||
"WinUtil" {
|
|
||||||
# Use Powershell 7 if installed and fallback to PS5 if not
|
|
||||||
if (Get-Command "pwsh" -ErrorAction SilentlyContinue) {
|
|
||||||
$shell = "pwsh.exe"
|
|
||||||
} else {
|
|
||||||
$shell = "powershell.exe"
|
|
||||||
}
|
|
||||||
|
|
||||||
$shellArgs = "-ExecutionPolicy Bypass -Command `"Start-Process $shell -verb runas -ArgumentList `'-Command `"irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1 | iex`"`'"
|
|
||||||
|
|
||||||
$DestinationName = "WinUtil.lnk"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Show a File Dialog Browser, to let the User choose the Name and Location of where to save the Shortcut
|
|
||||||
$FileBrowser = New-Object System.Windows.Forms.SaveFileDialog
|
|
||||||
$FileBrowser.InitialDirectory = [Environment]::GetFolderPath('Desktop')
|
|
||||||
$FileBrowser.Filter = "Shortcut Files (*.lnk)|*.lnk"
|
|
||||||
$FileBrowser.FileName = $DestinationName
|
|
||||||
|
|
||||||
# Do an Early Return if the Save Operation was canceled by User's Input.
|
|
||||||
$FileBrowserResult = $FileBrowser.ShowDialog()
|
|
||||||
$DialogResultEnum = New-Object System.Windows.Forms.DialogResult
|
|
||||||
if (-not ($FileBrowserResult -eq $DialogResultEnum::OK)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
# Prepare the Shortcut paramter
|
|
||||||
$WshShell = New-Object -comObject WScript.Shell
|
|
||||||
$Shortcut = $WshShell.CreateShortcut($FileBrowser.FileName)
|
|
||||||
$Shortcut.TargetPath = $shell
|
|
||||||
$Shortcut.Arguments = $shellArgs
|
|
||||||
if (-NOT (Test-Path -Path $winutildir["logo.ico"])) {
|
|
||||||
Invoke-WebRequest -Uri "https://christitus.com/images/logo-full.ico" -OutFile $winutildir["logo.ico"]
|
|
||||||
}
|
|
||||||
if (Test-Path -Path $winutildir["logo.ico"]) {
|
|
||||||
$shortcut.IconLocation = $winutildir["logo.ico"]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Save the Shortcut to disk
|
|
||||||
$Shortcut.Save()
|
|
||||||
|
|
||||||
if ($RunAsAdmin -eq $true) {
|
|
||||||
$bytes = [System.IO.File]::ReadAllBytes($FileBrowser.FileName)
|
|
||||||
# Set byte value at position 0x15 in hex, or 21 in decimal, from the value 0x00 to 0x20 in hex
|
|
||||||
$bytes[0x15] = $bytes[0x15] -bor 0x20
|
|
||||||
[System.IO.File]::WriteAllBytes($FileBrowser.FileName, $bytes)
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Shortcut for $ShortcutToAdd has been saved to $($FileBrowser.FileName) with 'Run as administrator' set to $RunAsAdmin"
|
|
||||||
}
|
|
@ -42,4 +42,24 @@ function Invoke-WPFUpdatesdefault {
|
|||||||
Write-Host "==================================================="
|
Write-Host "==================================================="
|
||||||
Write-Host "--- Windows Update Settings Reset to Default ---"
|
Write-Host "--- Windows Update Settings Reset to Default ---"
|
||||||
Write-Host "==================================================="
|
Write-Host "==================================================="
|
||||||
|
|
||||||
|
Start-Process -FilePath "secedit" -ArgumentList "/configure /cfg $env:windir\inf\defltbase.inf /db defltbase.sdb /verbose" -Wait
|
||||||
|
Start-Process -FilePath "cmd.exe" -ArgumentList "/c RD /S /Q $env:WinDir\System32\GroupPolicyUsers" -Wait
|
||||||
|
Start-Process -FilePath "cmd.exe" -ArgumentList "/c RD /S /Q $env:WinDir\System32\GroupPolicy" -Wait
|
||||||
|
Start-Process -FilePath "gpupdate" -ArgumentList "/force" -Wait
|
||||||
|
Remove-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKCU:\Software\Microsoft\WindowsSelfHost" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKCU:\Software\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\Microsoft\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\Microsoft\WindowsSelfHost" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\WOW6432Node\Microsoft\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
Remove-Item -Path "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
Write-Host "==================================================="
|
||||||
|
Write-Host "--- Windows Local Policies Reset to Default ---"
|
||||||
|
Write-Host "==================================================="
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
{{ super() }}
|
{{ super() }}
|
||||||
<div style="color: red; text-align: center; padding: 10px; font-size: 20px;">
|
<div style="color: red; text-align: center; padding: 10px; font-size: 20px;">
|
||||||
<strong>Announcement:</strong> We are currently not adding any applications to WinUtil and any apps that will be added through a PR will be declined by the maintainer.
|
<strong>Announcement:</strong> We are currently not adding any applications to WinUtil and any apps that will be added through a PR will be declined by the maintainer.
|
||||||
|
<strong>Announcement:</strong> We are currently reworking the docs to use Hugo rather then mkdocs.
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user