format and add scripts for Windows OS

This commit is contained in:
2025-12-17 12:32:23 +01:00
parent 91d4014314
commit 03920c759c
5 changed files with 54 additions and 22 deletions

View File

@@ -1,19 +1,19 @@
$keepConfigs = @('R_Wikigames_Eng','D_Wikigames_Eng')
$keepConfigs = @('R_Wikigames_Eng', 'D_Wikigames_Eng')
$projects = Get-Project -All
foreach ($proj in $projects) {
Write-Host "Project: $($proj.Name)"
Write-Host "Project: $($proj.Name)"
# ConfigurationManager (DTE)
$configMgr = $proj.ConfigurationManager
$configNames = $configMgr.ConfigurationRowNames
$configMgr = $proj.ConfigurationManager
$configNames = $configMgr.ConfigurationRowNames
foreach ($cfg in $configNames) {
# remove config if not in keepConfigs
if ($cfg -notin $keepConfigs) {
Write-Host "- remove config: $cfg"
$configMgr.DeleteConfigurationRow($cfg)
}
}
foreach ($cfg in $configNames) {
# remove config if not in keepConfigs
if ($cfg -notin $keepConfigs) {
Write-Host "- remove config: $cfg"
$configMgr.DeleteConfigurationRow($cfg)
}
}
}

View File

@@ -3,17 +3,17 @@ $keepConfig = 'R_Wikigames_Eng'
$projects = Get-Project -All
foreach ($proj in $projects) {
Write-Host "Elaborazione progetto: $($proj.Name)"
Write-Host "Elaborazione progetto: $($proj.Name)"
# ConfigurationManager (DTE)
$configMgr = $proj.ConfigurationManager
$configNames = $configMgr.ConfigurationRowNames
# ConfigurationManager (DTE)
$configMgr = $proj.ConfigurationManager
$configNames = $configMgr.ConfigurationRowNames
foreach ($cfg in $configNames) {
if ($cfg -ne $keepConfig) {
# remove config
Write-Host "- remove config: $cfg"
$configMgr.DeleteConfigurationRow($cfg)
}
}
foreach ($cfg in $configNames) {
if ($cfg -ne $keepConfig) {
# remove config
Write-Host "- remove config: $cfg"
$configMgr.DeleteConfigurationRow($cfg)
}
}
}

View File

@@ -0,0 +1,9 @@
# WIP
$SourceFilePath = ""
$ShortcutPath = ".lnk"
$WScriptObj = New-Object -ComObject ("WScript.Shell")
$shortcut = $WscriptObj.CreateShortcut($ShortcutPath)
$shortcut.TargetPath = $SourceFilePath
$shortcut.Save()

View File

@@ -0,0 +1,20 @@
@echo off
:: Resets folder view settings, window size and position of all folders
Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU" /F
Reg Delete "HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags" /F
:: To reset "Apply to Folders" views to default for all folder types
REG Delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults" /F
:: To reset size of details, navigation, preview panes to default for all folders
Reg Delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Modules\GlobalSettings\Sizer" /F
Reg Delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Modules\NavPane" /F
:: To reset size of Save as amd Open dialogs to default for all folders
Reg Delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CIDOpen" /F
Reg Delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CIDSave" /F
Reg Delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32" /F
:: To kill and restart explorer process
taskkill /F /IM explorer.exe
start explorer.exe

View File

@@ -0,0 +1,3 @@
:: Using the /ResetBase parameter together with the /StartComponentCleanup parameter of DISM.exe on a running version of Windows 10 or later removes all superseded versions of every component in the component store.
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase