General: Format output and commands better ADMIN.bat: Make administrator group removal apply to all users Fix admin log-off task to make it work on battery and always show a message (Previously the pop-up message would usually not show), and make it work with domains other than WINDOWS-PC by scheduling a new task instead of importing XML files CHOC.bat: Move start menu open action from tiles.ps1 (Removed) Remove unnecessary clickstart.ps1 action Add Open-Shell start menu open action (This is just for loading the images of applications, and is NOT necessary for loading the custom Open-Shell registry settings) Make Open-Shell registry configuration apply to all users Disable Open-Shell update checks Disable Open-Shell Windows update checks Disable Open-Shell highlight new programs EDGE.bat: Make registry modifications apply to all users Remove useless SetLocal FIREFOXDEF.bat > FILEASSOC.bat: Transition from SetDefaultBrowser to custom PowerShell method inspired by https://github.com/DanysysTeam/PS-SFTA/blob/master/SFTA.ps1 that uses registry edits with a hashing mechanism Make configuration apply to all users AME-Firefox-Injection-Script > FIREFOXCONF.bat: Make injection apply to all users PYTH.bat: Remove SECUI.bat reliance and instead use python directly REGI.bat: Add user registry hive mount function for mounting hives of non-active users Make registry modifications apply to all users Add registry edit to disable Security and Maintenance notifications Add registry edit to disable pesky backup reminder notifications Add registry edit to prevent "NVIDIA Control Panel not found" message upon NVIDIA driver installation Remove SEARCH.bat reliance and instead use reg.exe directly SERV.bat: Add removal of the AppReadiness service, which is the cause of most of the black screen issues that have occurred. This service is a manually run service that is used for deploying new APPX applications, and for installing system APPX applications to new users, or existing users that have not yet had all the apps installed AME-SFC-Modification-Script.cmd > SFCDEPLOY.bat SHRT.bat: Use new shortcut creation using PowerShell + wscript instead of copying pre-made ones Make new shortcut configuration apply to all users SLNT.bat: Fix OldNewExplorer and OldCalculator not installing at all Make OldNewExplorer registry configuration apply to all users TILE.bat: Remove tiles.ps1 reliance and re-code it in batch Use LayoutModification.xml method instead of temporarily locking the start layout Add taskbar configuration to custom layout WALLPAPER.bat: Make changes apply to all users scoop.ps1: Make scoop install as a global program instead of current user only Make Windows Terminal and git install globally for all users instead of current user onlymaster
@ -1,3 +1,12 @@ | |||
net user administrator /active:yes | |||
net user Administrator /active:yes | |||
net user Administrator malte | |||
net localgroup administrators %username% /delete | |||
@echo OFF | |||
for /f "usebackq delims=" %%A in (`net localgroup users ^| findstr /V /I /c:"NT AUTHORITY\\" /c:"Alias name" /c:"Comment" /c:"Members" /c:"------------------------------------------------------------" /c:"The command completed"`) do ( | |||
echo net localgroup administrators "%%A" /delete | |||
net localgroup administrators "%%A" /delete | |||
) | |||
@echo ON | |||
schtasks /create /tn "AME Admin Log-off" /tr "CMD /C 'SCHTASKS /run /tn 'AME Admin Log-off Msg' & Logoff'" /ru "Administrator" /sc ONLOGON /it /rl HIGHEST /f > NUL | |||
PowerShell -NoP -C "$TaskSet = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries; Set-ScheduledTask -TaskName 'AME Admin Log-off Msg' -Settings $TaskSet" > NUL | |||
schtasks /create /tn "AME Admin Log-off Msg" /tr "PowerShell -NoP -C 'While($lim -lt 20){WMIC computersystem get username|findstr /c:'\Administrator ';if(!$?){Break};$lim++;Sleep 1};'''Logging in as the Administrator user is not supported on AME.`nPlease login using a different account.'''|Msg *'" /sc MONTHLY /f /rl HIGHEST /ru "SYSTEM" > NUL | |||
PowerShell -NoP -C "$TaskSet = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries; Set-ScheduledTask -TaskName 'AME Admin Log-off Msg' -Settings $TaskSet; $serv = New-Object -ComObject Schedule.Service; $serv.Connect($env:COMPUTERNAME); $folder = $serv.GetFolder('\'); $task = $folder.GetTask('AME Admin Log-off Msg'); $item = $task.Definition; $item.Triggers.Remove(1); $folder.RegisterTaskDefinition($task.Name, $item, 4, $null, $null, $null)" > NUL |
@ -1,169 +0,0 @@ | |||
@ECHO OFF | |||
NET SESSION > NUL 2>&1 | |||
IF %ERRORLEVEL% NEQ 0 ( | |||
ECHO Script must be run from an elevated cmd prompt | |||
EXIT /B 1 | |||
) | |||
ECHO. & ECHO ^| AME Firefox Injection Script v3.0 ^| & ECHO. | |||
IF NOT EXIST "%~dp0\AME-Firefox-Injection" ( | |||
ECHO No supplied AME-Firefox-Injection folder detected. | |||
EXIT /B 4 | |||
) | |||
:ENTRIES | |||
ECHO Grabbing previous Firefox entries... | |||
IF NOT EXIST "%TEMP%\Firefox-Reg-Output.txt" ECHO No input entries detected & ECHO. & ECHO Generating random string... & ECHO. & GOTO GenRND | |||
SETLOCAL EnableDelayedExpansion | |||
SET /A "count1=0" | |||
FOR /F "usebackq tokens=2 delims=-" %%A IN (`FINDSTR /c:"Firefox-" "%TEMP%\Firefox-Reg-Output.txt"`) DO ( | |||
SET /A "count1=!count1!+1" | |||
SET "ffBef!count1!=%%A" | |||
SET "par=!par!)" | |||
SET "arg=!arg!IF NOT "%%D"=="%%A" (" | |||
) | |||
DEL /Q /F "%TEMP%\Firefox-Reg-Output.txt" > NUL 2>&1 | |||
ECHO. & ECHO Grabbing and comparing Firefox entries... | |||
SET /A "count2=0" | |||
FOR /F "usebackq tokens=2 delims=-" %%D IN (`REG query "HKLM\SOFTWARE\Clients\StartMenuInternet" /f "Firefox-"`) DO ( | |||
SET /A "count2=!count2!+1" | |||
%arg%SET "NewCode=%%D"%par% | |||
) | |||
ECHO. & ECHO Generating random string... & ECHO. | |||
:GenRND | |||
SET "RNDConsist=abcdefghijklmnopqrstuvwxyz0123456789" | |||
SET /A "RND=%RANDOM% %% 36" | |||
SET "RNDResult=!RNDResult!!RNDConsist:~%RND%,1!" | |||
IF "%RNDResult:~7%"=="" (GOTO GenRND) | |||
IF "%count1%"=="0" (IF "%count2%"=="0" (SET "NewCode=NULL")) | |||
ENDLOCAL & SET "NewCode=%NewCode%" & SET "RNDStr=%RNDResult%" | |||
:CHECKS | |||
REM Redundancy, incase the original Firefox installed check fails | |||
IF "%NewCode%"=="NULL" ECHO No Firefox install detected & ECHO. & SET "prefsOnly=true" | |||
IF "%NewCode%"=="" ECHO Firefox version already installed & ECHO. & SET "prefsOnly=true" | |||
IF NOT EXIST "%PROGRAMFILES%\Mozilla Firefox\firefox.exe" ECHO Can't find Firefox.exe & ECHO. & SET "prefsOnly=true" | |||
IF EXIST "%APPDATA%\Mozilla\Firefox\profiles.ini" ( | |||
FINDSTR /c:"%NewCode%" "%APPDATA%\Mozilla\Firefox\profiles.ini" > NUL 2>&1 | |||
IF NOT ERRORLEVEL 1 ECHO Firefox version already in profiles.ini & ECHO. & SET "prefsOnly=true" | |||
) | |||
IF "%prefsOnly%"=="true" GOTO PREFSONLY | |||
SET /A "count0=1" | |||
:PROFILENAME | |||
IF %count0% GTR 50 ECHO Default-release count exceeded 50 & GOTO PREFSONLY | |||
IF EXIST "%APPDATA%\Mozilla\Firefox\profiles.ini" ( | |||
FINDSTR /c:"Name=default-release" "%APPDATA%\Mozilla\Firefox\profiles.ini" > NUL 2>&1 | |||
IF NOT ERRORLEVEL 1 ( | |||
FINDSTR /c:"Name=default-release-%count0%" "%APPDATA%\Mozilla\Firefox\profiles.ini" | |||
IF NOT ERRORLEVEL 1 ( | |||
SET /A "count0=%count0%+1" | |||
GOTO PROFILENAME | |||
) ELSE ( | |||
SET "profileName=default-release-%count0%" | |||
) | |||
) ELSE ( | |||
SET "profileName=default-release" | |||
) | |||
) ELSE ( | |||
SET "profileName=default-release" | |||
) | |||
ECHO Injecting profile... | |||
REM This could also be set manually in the profiles.ini file | |||
POWERSHELL -NoP -C "Start-Process '%PROGRAMFILES%\Mozilla Firefox\firefox.exe' -ArgumentList '-CreateProfile','"""%profileName% %APPDATA%\Mozilla\Firefox\Profiles\%RNDStr%.%profileName%"""','--no-remote' -Wait" | |||
ROBOCOPY "%~dp0\AME-Firefox-Injection" "%APPDATA%\Mozilla\Firefox\Profiles\%RNDStr%.%profileName%" /E > NUL | |||
REM Sets profile as the default | |||
ECHO [Install%NewCode%]>> "%APPDATA%\Mozilla\Firefox\profiles.ini" | |||
ECHO Default=Profiles/%RNDStr%.%profileName%>> "%APPDATA%\Mozilla\Firefox\profiles.ini" | |||
ECHO Locked=^1>> "%APPDATA%\Mozilla\Firefox\profiles.ini" | |||
REM Add prefs to any other Firefox profiles in all users | |||
FOR /F "usebackq delims=" %%A IN (`DIR /B /A:d "%SYSTEMDRIVE%\Users"`) DO ( | |||
IF EXIST "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles" ( | |||
FOR /F "usebackq delims=" %%B IN (`DIR /B /A:d "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles" ^| FINDSTR /v /x /c:"%RNDStr%.%profileName%"`) DO ( | |||
SET /A "count3=%count3%+1" | |||
IF EXIST "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\prefs.js" ( | |||
REM Removes lines containing these entries from the profiles prefs.js. This way any old prefs don't overlap with the new prefs | |||
FINDSTR /V /C:""""app.shield.optoutstudies.enabled"""" /C:""""browser.aboutwelcome.enabled"""" /C:""""browser.disableResetPrompt"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features"""" /C:""""browser.newtabpage.activity-stream.feeds.section.topstories"""" /C:""""browser.newtabpage.activity-stream.feeds.topsites"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includePocket"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includeVisited"""" /C:""""browser.newtabpage.activity-stream.showSponsored"""" /C:""""browser.newtabpage.activity-stream.showSponsoredTopSites"""" /C:""""browser.urlbar.placeholderNam"""" /C:""""browser.urlbar.suggest.quicksuggest.nonsponsored"""" /C:""""browser.urlbar.suggest.quicksuggest.sponsored"""" /C:""""browser.urlbar.suggest.topsites"""" /C:""""datareporting.healthreport.uploadEnabled"""" /C:""""dom.security.https_only_mode"""" /C:""""dom.security.https_only_mode_ever_enabled"""" "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\prefs.js ">> "%TEMP%\prefs.js.tmp" | |||
) | |||
REM Filters out a few prefs from AME-Firefox-Injectiont\prefs.js and adds them to prefs.js.tmp | |||
FINDSTR /V /C:""""browser.toolbars.bookmarks.visibility"""" /C:""""extensions.webextensions.uuids"""" /C:""""extensions.webextensions.uuids"""" "%~dp0\AME-Firefox-Injection\prefs.js" >> "%TEMP%\prefs.js.tmp" | |||
MOVE /Y "%TEMP%\prefs.js.tmp" "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\prefs.js" > NUL | |||
IF EXIST "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4" DEL /Q /F "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4" > NUL | |||
ROBOCOPY "%~dp0\AME-Firefox-Injection" "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B" search.json.mozlz4 /E > NUL | |||
POWERSHELL -NoP -C "Get-Acl '%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles' | Set-Acl '%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\prefs.js'" > NUL 2>&1 | |||
POWERSHELL -NoP -C "Get-Acl '%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles' | Set-Acl '%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4'" > NUL 2>&1 | |||
) | |||
) | |||
) | |||
SET "ERRORCODE=0" | |||
GOTO COMPLETE | |||
:PREFSONLY | |||
REM uBlock Origin could be installed automatically here, however that would involve overwriting the old extension.json etc | |||
REM files, which, if the user had previous extensions, could cause issues. | |||
ECHO Injecting config files... | |||
IF EXIST "%TEMP%\prefs.js.tmp" DEL /F /Q "%TEMP%\prefs.js.tmp" > NUL | |||
SET /A "count3=0" | |||
FOR /F "usebackq delims=" %%A IN (`DIR /B /A:d "%APPDATA%\Mozilla\Firefox\Profiles"`) DO ( | |||
SET /A "count3=%count3%+1" | |||
IF EXIST "%APPDATA%\Mozilla\Firefox\Profiles\%%A\prefs.js" ( | |||
REM Removes lines containing these entries from the profiles prefs.js. This way any old prefs don't overlap with the new prefs | |||
FINDSTR /V /C:""""app.shield.optoutstudies.enabled"""" /C:""""browser.aboutwelcome.enabled"""" /C:""""browser.disableResetPrompt"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features"""" /C:""""browser.newtabpage.activity-stream.feeds.section.topstories"""" /C:""""browser.newtabpage.activity-stream.feeds.topsites"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includePocket"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includeVisited"""" /C:""""browser.newtabpage.activity-stream.showSponsored"""" /C:""""browser.newtabpage.activity-stream.showSponsoredTopSites"""" /C:""""browser.urlbar.placeholderNam"""" /C:""""browser.urlbar.suggest.quicksuggest.nonsponsored"""" /C:""""browser.urlbar.suggest.quicksuggest.sponsored"""" /C:""""browser.urlbar.suggest.topsites"""" /C:""""datareporting.healthreport.uploadEnabled"""" /C:""""dom.security.https_only_mode"""" /C:""""dom.security.https_only_mode_ever_enabled"""" "%APPDATA%\Mozilla\Firefox\Profiles\%%A\prefs.js ">> "%TEMP%\prefs.js.tmp" | |||
) | |||
REM Filters out a few prefs from AME-Firefox-Injectiont\prefs.js and adds them to prefs.js.tmp | |||
FINDSTR /V /C:""""browser.toolbars.bookmarks.visibility"""" /C:""""extensions.webextensions.uuids"""" /C:""""extensions.webextensions.uuids"""" "%~dp0\AME-Firefox-Injection\prefs.js" >> "%TEMP%\prefs.js.tmp" | |||
MOVE /Y "%TEMP%\prefs.js.tmp" "%APPDATA%\Mozilla\Firefox\Profiles\%%A\prefs.js" > NUL | |||
IF EXIST "%APPDATA%\Mozilla\Firefox\Profiles\%%A\search.json.mozlz4" DEL /Q /F "%APPDATA%\Mozilla\Firefox\Profiles\%%A\search.json.mozlz4" > NUL | |||
ROBOCOPY "%~dp0\AME-Firefox-Injection" "%APPDATA%\Mozilla\Firefox\Profiles\%%A" search.json.mozlz4 /E > NUL | |||
) | |||
FOR /F "usebackq delims=" %%A IN (`DIR /B /A:d "%SYSTEMDRIVE%\Users"`) DO ( | |||
IF EXIST "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles" ( | |||
FOR /F "usebackq delims=" %%B IN (`DIR /B /A:d "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles"`) DO ( | |||
SET /A "count3=%count3%+1" | |||
IF EXIST "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\prefs.js" ( | |||
REM Removes lines containing these entries from the profiles prefs.js. This way any old prefs don't overlap with the new prefs | |||
FINDSTR /V /C:""""app.shield.optoutstudies.enabled"""" /C:""""browser.aboutwelcome.enabled"""" /C:""""browser.disableResetPrompt"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features"""" /C:""""browser.newtabpage.activity-stream.feeds.section.topstories"""" /C:""""browser.newtabpage.activity-stream.feeds.topsites"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includePocket"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includeVisited"""" /C:""""browser.newtabpage.activity-stream.showSponsored"""" /C:""""browser.newtabpage.activity-stream.showSponsoredTopSites"""" /C:""""browser.urlbar.placeholderNam"""" /C:""""browser.urlbar.suggest.quicksuggest.nonsponsored"""" /C:""""browser.urlbar.suggest.quicksuggest.sponsored"""" /C:""""browser.urlbar.suggest.topsites"""" /C:""""datareporting.healthreport.uploadEnabled"""" /C:""""dom.security.https_only_mode"""" /C:""""dom.security.https_only_mode_ever_enabled"""" "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\prefs.js ">> "%TEMP%\prefs.js.tmp" | |||
) | |||
REM Filters out a few prefs from AME-Firefox-Injectiont\prefs.js and adds them to prefs.js.tmp | |||
FINDSTR /V /C:""""browser.toolbars.bookmarks.visibility"""" /C:""""extensions.webextensions.uuids"""" /C:""""extensions.webextensions.uuids"""" "%~dp0\AME-Firefox-Injection\prefs.js" >> "%TEMP%\prefs.js.tmp" | |||
MOVE /Y "%TEMP%\prefs.js.tmp" "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\prefs.js" > NUL | |||
IF EXIST "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4" DEL /Q /F "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4" > NUL | |||
ROBOCOPY "%~dp0\AME-Firefox-Injection" "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B" search.json.mozlz4 /E > NUL | |||
POWERSHELL -NoP -C "Get-Acl '%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles' | Set-Acl '%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\prefs.js'" > NUL 2>&1 | |||
POWERSHELL -NoP -C "Get-Acl '%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles' | Set-Acl '%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4'" > NUL 2>&1 | |||
) | |||
) | |||
) | |||
IF %count3% EQU 0 ECHO Failed! No profiles detected & SET "ERRORCODE=2" & GOTO COMPLETE | |||
SET "ERRORCODE=1" | |||
:COMPLETE | |||
IF NOT %ERRORCODE% EQU 2 ECHO. & ECHO Successfully injected custom Firefox configs. | |||
EXIT /B %ERRORCODE% | |||
REM Errorcode 0 = Created new profile and injected; 1 = Firefox existed, injected custom prefs.js and search.json.mozlz4; 2 = Totally failed, no firefox detected, no profiles detected; 4 = No supplied AME-Firefox-Injection folder detected. |
@ -1,47 +0,0 @@ | |||
<?xml version="1.0" encoding="UTF-16"?> | |||
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |||
<RegistrationInfo> | |||
<Date>2021-02-10T20:04:12.7491874</Date> | |||
<Author>WINDOWS-PC\Administrator</Author> | |||
<URI>\Log-off admin message</URI> | |||
</RegistrationInfo> | |||
<Triggers> | |||
<LogonTrigger> | |||
<Enabled>true</Enabled> | |||
<UserId>WINDOWS-PC\Administrator</UserId> | |||
</LogonTrigger> | |||
</Triggers> | |||
<Principals> | |||
<Principal id="Author"> | |||
<UserId>System</UserId> | |||
<RunLevel>HighestAvailable</RunLevel> | |||
</Principal> | |||
</Principals> | |||
<Settings> | |||
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> | |||
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> | |||
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> | |||
<AllowHardTerminate>true</AllowHardTerminate> | |||
<StartWhenAvailable>false</StartWhenAvailable> | |||
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> | |||
<IdleSettings> | |||
<StopOnIdleEnd>true</StopOnIdleEnd> | |||
<RestartOnIdle>false</RestartOnIdle> | |||
</IdleSettings> | |||
<AllowStartOnDemand>true</AllowStartOnDemand> | |||
<Enabled>true</Enabled> | |||
<Hidden>false</Hidden> | |||
<RunOnlyIfIdle>false</RunOnlyIfIdle> | |||
<DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession> | |||
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine> | |||
<WakeToRun>false</WakeToRun> | |||
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit> | |||
<Priority>7</Priority> | |||
</Settings> | |||
<Actions Context="Author"> | |||
<Exec> | |||
<Command>powershell.exe</Command> | |||
<Arguments>Write-Output 'Logging in as the Administrator user is not supported on AME.' 'Please login using a different account.' | Msg *</Arguments> | |||
</Exec> | |||
</Actions> | |||
</Task> |
@ -1,46 +0,0 @@ | |||
<?xml version="1.0" encoding="UTF-16"?> | |||
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |||
<RegistrationInfo> | |||
<Date>2021-02-10T19:24:15.5621439</Date> | |||
<Author>WINDOWS-PC\Administrator</Author> | |||
<URI>\Log-off admin user</URI> | |||
</RegistrationInfo> | |||
<Triggers> | |||
<LogonTrigger> | |||
<Enabled>true</Enabled> | |||
<UserId>WINDOWS-PC\Administrator</UserId> | |||
</LogonTrigger> | |||
</Triggers> | |||
<Principals> | |||
<Principal id="Author"> | |||
<UserId>System</UserId> | |||
<LogonType>InteractiveToken</LogonType> | |||
<RunLevel>LeastPrivilege</RunLevel> | |||
</Principal> | |||
</Principals> | |||
<Settings> | |||
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> | |||
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> | |||
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> | |||
<AllowHardTerminate>true</AllowHardTerminate> | |||
<StartWhenAvailable>false</StartWhenAvailable> | |||
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> | |||
<IdleSettings> | |||
<StopOnIdleEnd>true</StopOnIdleEnd> | |||
<RestartOnIdle>false</RestartOnIdle> | |||
</IdleSettings> | |||
<AllowStartOnDemand>true</AllowStartOnDemand> | |||
<Enabled>true</Enabled> | |||
<Hidden>false</Hidden> | |||
<RunOnlyIfIdle>false</RunOnlyIfIdle> | |||
<WakeToRun>false</WakeToRun> | |||
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit> | |||
<Priority>7</Priority> | |||
</Settings> | |||
<Actions Context="Author"> | |||
<Exec> | |||
<Command>cmd.exe</Command> | |||
<Arguments>/c c:\windows\system32\logoff.exe</Arguments> | |||
</Exec> | |||
</Actions> | |||
</Task> |
@ -1,69 +0,0 @@ | |||
@ECHO OFF | |||
ECHO. & ECHO ^| AME SFC Modification Deployment Script v2.5 ^| & ECHO. | |||
NET session > NUL 2>&1 | |||
IF %ERRORLEVEL% LSS 1 ( | |||
GOTO sfcCmdChecks | |||
) ELSE ( | |||
ECHO Script must be run from an elevated cmd prompt | |||
EXIT /B 1 | |||
) | |||
:sfcCmdChecks | |||
IF NOT EXIST "%~dp0\sfc.cmd" ( | |||
ECHO No supplied sfc.cmd detected | |||
EXIT /B 2 | |||
) | |||
IF EXIST "%SYSTEMROOT%\System32\sfc.cmd" ( | |||
TAKEOWN /f "%SYSTEMROOT%\System32\sfc.cmd" /a > NUL 2>&1 | |||
ICACLS "%SYSTEMROOT%\System32\sfc.cmd" /grant Administrators:F > NUL 2>&1 | |||
DEL /Q /F "%SYSTEMROOT%\System32\sfc.cmd" | |||
GOTO move | |||
) ELSE ( | |||
GOTO move | |||
) | |||
:move | |||
MOVE /Y "%~dp0\sfc.cmd" "%SYSTEMROOT%\System32\" 1> NUL | |||
:sfc1ExeCheck | |||
IF EXIST "%SYSTEMROOT%\System32\sfc1.exe" ( | |||
ECHO sfc1.exe already exists, assigning permissions... & ECHO. | |||
POWERSHELL -NoP -C "Get-Acl '%SYSTEMROOT%\System32\diskmgmt.msc' | Set-Acl '%SYSTEMROOT%\System32\sfc1.exe'" > NUL 2>&1 | |||
POWERSHELL -NoP -C "Get-Acl '%SYSTEMROOT%\System32\diskmgmt.msc' | Set-Acl '%SYSTEMROOT%\System32\sfc.cmd'" > NUL 2>&1 | |||
GOTO complete | |||
) ELSE ( | |||
GOTO managePermissions | |||
) | |||
:managePermissions | |||
ECHO Assigning permissions and renaming sfc.exe... & ECHO. | |||
REM Copies the ACL from diskmgmt.msc to sfc.cmd. | |||
POWERSHELL -NoP -C "Get-Acl '%SYSTEMROOT%\System32\diskmgmt.msc' | Set-Acl '%SYSTEMROOT%\System32\sfc.cmd'" > NUL 2>&1 | |||
REM Gives the Administrator group full access for renaming sfc.exe to sfc1.exe. | |||
TAKEOWN /f "%SYSTEMROOT%\System32\sfc.exe" /a > NUL 2>&1 | |||
ICACLS "%SYSTEMROOT%\System32\sfc.exe" /grant Administrators:F > NUL 2>&1 | |||
GOTO renameSFCExe | |||
:renameSFCExe | |||
REN "%SYSTEMROOT%\System32\sfc.exe" "sfc1.exe" > NUL 2>&1 | |||
REM Copies the ACL from diskmgmt.msc to sfc1.exe. Essentially resetting its ACL. | |||
POWERSHELL -NoP -C "Get-Acl '%SYSTEMROOT%\System32\diskmgmt.msc' | Set-Acl '%SYSTEMROOT%\System32\sfc1.exe'" > NUL 2>&1 | |||
GOTO complete | |||
:complete | |||
ECHO Successfully deployed sfc modification. | |||
EXIT /B 0 |
@ -1,42 +1,42 @@ | |||
PowerShell -Command "Get-AppxPackage -allusers *Microsoft.549981C3F5F10* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *3DViewer* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *AssignedAccessLockApp* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *PinningConfirmationDialog* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *SecureAssessmentBrowser* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *FeedbackHub* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *MixedReality* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *Microsoft.Calculator* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *Microsoft.WindowsAlarms* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *Microsoft.GetHelp* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *Getstarted* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *disney* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *Microsoft.OneConnect* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *WindowsCamera* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *bing* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *Sticky* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *Store* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *MicrosoftOfficeHub* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *Paint* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *wallet* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *OneNote* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *Microsoft.People* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *WindowsPhone* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *YourPhone* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *photos* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *SkypeApp* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *solit* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *spotify* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *WindowsSoundRecorder* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *zune* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *WindowsCalculator* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *WindowsMaps* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *Sway* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *CommsPhone* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *ConnectivityStore* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *Microsoft.Messaging* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *Microsoft.WindowsStore* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *XboxApp* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *XboxSpeechToTextOverlay* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *XboxGamingOverlay* | Remove-AppxPackage" | |||
PowerShell -Command "Get-AppxPackage *XboxGameOverlay* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage -AllUsers *Microsoft.549981C3F5F10* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *3DViewer* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *AssignedAccessLockApp* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *PinningConfirmationDialog* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *SecureAssessmentBrowser* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *FeedbackHub* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *MixedReality* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *Microsoft.Calculator* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *Microsoft.WindowsAlarms* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *Microsoft.GetHelp* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *Getstarted* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *disney* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *Microsoft.OneConnect* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *WindowsCamera* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *bing* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *Sticky* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *Store* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *MicrosoftOfficeHub* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *Paint* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *wallet* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *OneNote* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *Microsoft.People* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *WindowsPhone* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *YourPhone* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *photos* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *SkypeApp* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *solit* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *spotify* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *WindowsSoundRecorder* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *zune* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *WindowsCalculator* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *WindowsMaps* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *Sway* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *CommsPhone* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *ConnectivityStore* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *Microsoft.Messaging* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *Microsoft.WindowsStore* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *XboxApp* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *XboxSpeechToTextOverlay* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *XboxGamingOverlay* | Remove-AppxPackage" | |||
PowerShell -NoP -C "Get-AppxPackage *XboxGameOverlay* | Remove-AppxPackage" |
@ -1,3 +1,4 @@ | |||
cd Executables | |||
start .\ViVeTool.exe addconfig 18299130 1 | |||
start .\ViVeTool.exe addconfig 31950543 1 |
@ -1,49 +1,78 @@ | |||
start explorer.exe | |||
reg query "HKLM\SOFTWARE\Clients\StartMenuInternet" /k /f "Firefox-" > "%TEMP%\Firefox-Reg-Output.txt" | |||
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin | |||
@powershell -NoProfile -ExecutionPolicy Bypass -Command "choco install -y --force --allow-empty-checksums firefox thunderbird open-shell vlc 7zip jpegview vcredist-all directx onlyoffice cascadiamono" | |||
:: Load tile layout from before | |||
PowerShell -NoP -C "(New-Object -ComObject wscript.shell).SendKeys('^{ESCAPE}')" | |||
timeout /t 3 > NUL | |||
PowerShell -NoP -C "(New-Object -ComObject wscript.shell).SendKeys('^{ESCAPE}')" | |||
@echo OFF | |||
for /f "usebackq tokens=2 delims=\" %%A in (`reg query "HKEY_USERS" ^| findstr /c:"S-" /c:"AME_UserHive_"`) do ( | |||
reg query "HKU\%%A" | findstr /c:"Volatile Environment" /c:"AME_UserHive_" > NUL 2>&1 | |||
if not errorlevel 1 call :CHOCCALL "%%A" | |||
) | |||
@echo ON | |||
@PowerShell -NoP -ExecutionPolicy Bypass -C "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && set "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" | |||
@PowerShell -NoP -ExecutionPolicy Bypass -C "choco install -y --force --allow-empty-checksums firefox thunderbird open-shell vlc 7zip jpegview vcredist-all directx onlyoffice cascadiamono" | |||
cd Executables | |||
copy Fluent-Metro.skin "C:\Program Files\Open-Shell\Skins" | |||
copy Fluent-Metro.skin7 "C:\Program Files\Open-Shell\Skins" | |||
powershell -NoProfile -ExecutionPolicy Bypass -File .\clickstart.ps1 | |||
for /f "tokens=* USEBACKQ" %%i in (`wmic useraccount where "name="%username%"" get sid ^| findstr "S-"`) do set currentusername=%%i | |||
set currentusername=%currentusername:~0,-3% | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell" /t REG_SZ /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\OpenShell" /t REG_SZ /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\OpenShell\Settings" /t REG_SZ /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu" /t REG_SZ /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /t REG_SZ /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\ClassicExplorer" /t REG_SZ /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\ClassicExplorer\Settings" /t REG_SZ /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\ClassicExplorer" /v "CSettingsDlg" /t REG_BINARY /d a8030000d00100000000000000000000aa0f00000100010100000000 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\ClassicExplorer" /v "ShowedToolbar" /t REG_DWORD /d 1 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\ClassicExplorer" /v "NewLine" /t REG_DWORD /d 0 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\ClassicExplorer\Settings" /v "ShowStatusBar" /t REG_DWORD /d 0 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu" /v "ShowedStyle2" /t REG_DWORD /d 1 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu" /v "CSettingsDlg" /t REG_BINARY /d c80100001a0100000000000000000000360d00000100000000000000 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu" /v "OldItems" /t REG_BINARY /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu" /v "ItemRanks" /t REG_BINARY /d 0 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\MRU" /v "0" /t REG_SZ /d "C:\Windows\regedit.exe" /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "Version" /t REG_DWORD /d 04040098 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "AllProgramsMetro" /t REG_DWORD /d 1 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "RecentMetroApps" /t REG_DWORD /d 1 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "StartScreenShortcut" /t REG_DWORD /d 0 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "SearchInternet" /t REG_DWORD /d 0 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "GlassOverride" /t REG_DWORD /d 1 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "GlassColor" /t REG_DWORD /d 0 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "SkinW7" /t REG_SZ /d "Fluent-Metro" /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "SkinVariationW7" /t REG_SZ /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "ShiftWin" /t REG_SZ /d "Nothing" /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "SkinOptionsW7" /t REG_MULTI_SZ /d "DARK_MAIN=0"\0"METRO_MAIN=0"\0"LIGHT_MAIN=0"\0"AUTOMODE_MAIN=1"\0"DARK_SUBMENU=0"\0"METRO_SUBMENU="\0"LIGHT_SUBMENU=0"\0"AUTOMODE_SUBMENU=1"\0"SUBMENU_SEPARATORS=1"\0"DARK_SEARCH=0"\0"METRO_SEARCH="\0"LIGHT_SEARCH=0"\0"AUTOMODE_SEARCH=1"\0"SEARCH_FRAME=1"\0"SEARCH_COLOR=0"\0"SMALL_SEARCH=0"\0"MOERN_SEARCH=1"\0"SEARCH_ITALICS=0"\0"NONE=0"\0"SEPARATOR=0"\0"TWO_TONE=1"\0"CLASSIC_SELECTOR=1"\0"HAF_SELECTOR=0"\0"CURVED_MENUSEL=1"\0"CURVED_SUBMENU=0"\0"SELECTOR_REVEAL=1"\0"TRANSPARENT=0"\0"OPAQU_SUBMENU=1"\0"OPAQUE_MENU=0"\0"OPAQUE=0"\0"STANDARD=0"\0"SMALL_MAIN2=1"\0"SMALL_ICONS=0"\0"COMPACT_UBMENU=0"\0"PRESERVE_MAIN2=0"\0"LESS_PADDING=0"\0"EXTRA_PADDING=1"\0"24_PADDING=0"\0"LARGE_PROGRAMS0"\0"TRANSPARENT_SHUTDOWN=0"\0"OUTLINE_SHUTDOWN=0"\0"BUTTON_SHUTDOWN=1"\0"EXPERIMENTAL_SHUTDOWN=0"\"LARGE_FONT=0"\0"CONNECTED_BORDER=1"\0"FLOATING_BORDER=0"\0"LARGE_SUBMENU=0"\0"LARGE_LISTS=0"\0"THI_MAIN2=0"\0"EXPERIMENTAL_MAIN2=1"\0"USER_IMAGE=1"\0"USER_OUTSIDE=0"\0"SCALING_USER=1"\0"56=0"\0"64="\0"TRANSPARENT_USER=0"\0"UWP_SCROLLBAR=0"\0"MODERN_SCROLLBAR=1"\0"SMALL_ARROWS=0"\0"ARROW_BACKGROUD=1"\0"ICON_FRAME=0"\0"SEARCH_SEPARATOR=0"\0"NO_PROGRAMS_BUTTON=0" /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "SkipMetro" /t REG_DWORD /d 1 /f | |||
reg add "HKEY_USERS\%currentusername%\SOFTWARE\OpenShell\StartMenu\Settings" /v "MenuItems7" /t REG_MULTI_SZ /d "Item1.Command=user_files"\0"Item1.Settings=NOEXPAND"\0"Item2.Command=user_documents"\0"Item2.Settings=NOEXPAND"\0"Item3.Command=user_pictures"\0"Item3.Settings=NOEXPAND"\0"Item4.Command=user_music"\0"Item4.Settings=NOEXPAND"\0"Item5.Command=user_videos"\0"Item5.Settings=NOEXPAND"\0"Item6.Command=downloads"\0"Item6.Settings=NOEXPAND"\0"Item7.Command=homegroup"\0"Item7.Settings=ITEM_DISABLED"\0"Item8.Command=separator"\0"Item9.Command=games"\0"Item9.Settings=TRACK_RECENT|NOEXPAND|ITEM_DISABLED"\0"Item10.Command=favorites"\0"Item10.Settings=ITEM_DISABLED"\0"Item11.Command=recent_documents"\0"Item12.Command=computer"\0"Item12.Settings=NOEXPAND"\0"Item13.Command=network"\0"Item13.Settings=ITEM_DISABLED"\0"Item14.Command=network_connections"\0"Item14.Settings=ITEM_DISABLED"\0"Item15.Command=separator"\0"Item16.Command=control_panel"\0"Item16.Settings=TRACK_RECENT"\0"Item17.Command=pc_settings"\0"Item17.Settings=TRACK_RECENT"\0"Item18.Command=admin"\0"Item18.Settings=TRACK_RECENT|ITEM_DISABLED"\0"Item19.Command=devices"\0"Item19.Settings=ITEM_DISABLED"\0"Item20.Command=defaults"\0"Item20.Settings=ITEM_DISABLED"\0"Item21.Command=help"\0"Item21.Settings=ITEM_DISABLED"\0"Item22.Command=run"\0"Item23.Command=apps"\0"Item23.Settings=ITEM_DISABLED"\0"Item24.Command=windows_security"\0"Item24.Settings=ITEM_DISABLED"\0" /f | |||
reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\Toolbar\ShellBrowser" /v "ITBar7Layout" /t REG_BINARY /d 13000000000000000000000020000000100000000000000001000000010700005e01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 /f | |||
del "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk" | |||
del "C:\Users\%username%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Microsoft Edge.lnk" | |||
del "C:\Users\%username%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Edge.lnk" | |||
copy Fluent-Metro.skin "C:\%PROGRAMFILES%\Open-Shell\Skins" | |||
copy Fluent-Metro.skin7 "%PROGRAMFILES%\Open-Shell\Skins" | |||
:: Load new Open-Shell menu | |||
PowerShell -NoP -C "(New-Object -ComObject wscript.shell).SendKeys('^{ESCAPE}')" | |||
timeout /t 3 > NUL | |||
PowerShell -NoP -C "(New-Object -ComObject wscript.shell).SendKeys('^{ESCAPE}')" | |||
@exit /b 0 | |||
:CHOCCALL | |||
@echo ON | |||
reg add "HKU\%~1\SOFTWARE\OpenShell" /t REG_SZ /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\OpenShell" /t REG_SZ /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\OpenShell\Settings" /t REG_SZ /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu" /t REG_SZ /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /t REG_SZ /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\ClassicExplorer" /t REG_SZ /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\ClassicExplorer\Settings" /t REG_SZ /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\ClassicExplorer" /v "CSettingsDlg" /t REG_BINARY /d a8030000d00100000000000000000000aa0f00000100010100000000 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\ClassicExplorer" /v "ShowedToolbar" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\ClassicExplorer" /v "NewLine" /t REG_DWORD /d 0 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\ClassicExplorer\Settings" /v "ShowStatusBar" /t REG_DWORD /d 0 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu" /v "ShowedStyle2" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu" /v "CSettingsDlg" /t REG_BINARY /d c80100001a0100000000000000000000360d00000100000000000000 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu" /v "OldItems" /t REG_BINARY /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu" /v "ItemRanks" /t REG_BINARY /d 0 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\MRU" /v "0" /t REG_SZ /d "C:\Windows\regedit.exe" /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "Version" /t REG_DWORD /d 04040098 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "AllProgramsMetro" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "RecentMetroApps" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "StartScreenShortcut" /t REG_DWORD /d 0 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "SearchInternet" /t REG_DWORD /d 0 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "GlassOverride" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "GlassColor" /t REG_DWORD /d 0 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "SkinW7" /t REG_SZ /d "Fluent-Metro" /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "SkinVariationW7" /t REG_SZ /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "ShiftWin" /t REG_SZ /d "Nothing" /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "SkinOptionsW7" /t REG_MULTI_SZ /d "DARK_MAIN=0"\0"METRO_MAIN=0"\0"LIGHT_MAIN=0"\0"AUTOMODE_MAIN=1"\0"DARK_SUBMENU=0"\0"METRO_SUBMENU="\0"LIGHT_SUBMENU=0"\0"AUTOMODE_SUBMENU=1"\0"SUBMENU_SEPARATORS=1"\0"DARK_SEARCH=0"\0"METRO_SEARCH="\0"LIGHT_SEARCH=0"\0"AUTOMODE_SEARCH=1"\0"SEARCH_FRAME=1"\0"SEARCH_COLOR=0"\0"SMALL_SEARCH=0"\0"MOERN_SEARCH=1"\0"SEARCH_ITALICS=0"\0"NONE=0"\0"SEPARATOR=0"\0"TWO_TONE=1"\0"CLASSIC_SELECTOR=1"\0"HAF_SELECTOR=0"\0"CURVED_MENUSEL=1"\0"CURVED_SUBMENU=0"\0"SELECTOR_REVEAL=1"\0"TRANSPARENT=0"\0"OPAQU_SUBMENU=1"\0"OPAQUE_MENU=0"\0"OPAQUE=0"\0"STANDARD=0"\0"SMALL_MAIN2=1"\0"SMALL_ICONS=0"\0"COMPACT_UBMENU=0"\0"PRESERVE_MAIN2=0"\0"LESS_PADDING=0"\0"EXTRA_PADDING=1"\0"24_PADDING=0"\0"LARGE_PROGRAMS0"\0"TRANSPARENT_SHUTDOWN=0"\0"OUTLINE_SHUTDOWN=0"\0"BUTTON_SHUTDOWN=1"\0"EXPERIMENTAL_SHUTDOWN=0"\"LARGE_FONT=0"\0"CONNECTED_BORDER=1"\0"FLOATING_BORDER=0"\0"LARGE_SUBMENU=0"\0"LARGE_LISTS=0"\0"THI_MAIN2=0"\0"EXPERIMENTAL_MAIN2=1"\0"USER_IMAGE=1"\0"USER_OUTSIDE=0"\0"SCALING_USER=1"\0"56=0"\0"64="\0"TRANSPARENT_USER=0"\0"UWP_SCROLLBAR=0"\0"MODERN_SCROLLBAR=1"\0"SMALL_ARROWS=0"\0"ARROW_BACKGROUD=1"\0"ICON_FRAME=0"\0"SEARCH_SEPARATOR=0"\0"NO_PROGRAMS_BUTTON=0" /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "SkipMetro" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "MenuItems7" /t REG_MULTI_SZ /d "Item1.Command=user_files"\0"Item1.Settings=NOEXPAND"\0"Item2.Command=user_documents"\0"Item2.Settings=NOEXPAND"\0"Item3.Command=user_pictures"\0"Item3.Settings=NOEXPAND"\0"Item4.Command=user_music"\0"Item4.Settings=NOEXPAND"\0"Item5.Command=user_videos"\0"Item5.Settings=NOEXPAND"\0"Item6.Command=downloads"\0"Item6.Settings=NOEXPAND"\0"Item7.Command=homegroup"\0"Item7.Settings=ITEM_DISABLED"\0"Item8.Command=separator"\0"Item9.Command=games"\0"Item9.Settings=TRACK_RECENT|NOEXPAND|ITEM_DISABLED"\0"Item10.Command=favorites"\0"Item10.Settings=ITEM_DISABLED"\0"Item11.Command=recent_documents"\0"Item12.Command=computer"\0"Item12.Settings=NOEXPAND"\0"Item13.Command=network"\0"Item13.Settings=ITEM_DISABLED"\0"Item14.Command=network_connections"\0"Item14.Settings=ITEM_DISABLED"\0"Item15.Command=separator"\0"Item16.Command=control_panel"\0"Item16.Settings=TRACK_RECENT"\0"Item17.Command=pc_settings"\0"Item17.Settings=TRACK_RECENT"\0"Item18.Command=admin"\0"Item18.Settings=TRACK_RECENT|ITEM_DISABLED"\0"Item19.Command=devices"\0"Item19.Settings=ITEM_DISABLED"\0"Item20.Command=defaults"\0"Item20.Settings=ITEM_DISABLED"\0"Item21.Command=help"\0"Item21.Settings=ITEM_DISABLED"\0"Item22.Command=run"\0"Item23.Command=apps"\0"Item23.Settings=ITEM_DISABLED"\0"Item24.Command=windows_security"\0"Item24.Settings=ITEM_DISABLED"\0" /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\OpenShell\Settings" /v "Update" /d 0 /t REG_DWORD /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "CheckWinUpdates" /t REG_DWORD /d 0 /f | |||
reg add "HKU\%~1\SOFTWARE\OpenShell\StartMenu\Settings" /v "HighlightNew" /t REG_DWORD /d 0 /f | |||
reg add "HKU\%~1\SOFTWARE\Microsoft\Internet Explorer\Toolbar\ShellBrowser" /v "ITBar7Layout" /t REG_BINARY /d 13000000000000000000000020000000100000000000000001000000010700005e01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 /f | |||
@echo OFF | |||
for /f "usebackq tokens=2* delims= " %%B in (`reg query "HKU\%~1\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "AppData" 2^>^&1 ^| findstr /R /X /C:".*AppData[ ]*REG_SZ[ ].*"`) do ( | |||
echo del "%%C\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk" /q /f | |||
del "%%C\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk" /q /f | |||
echo del "%%C\Microsoft\Internet Explorer\Quick Launch\Microsoft Edge.lnk" /q /f | |||
del "%%C\Microsoft\Internet Explorer\Quick Launch\Microsoft Edge.lnk" /q /f | |||
echo del "%%C\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Edge.lnk" /q /f | |||
del "%%C\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Edge.lnk" /q /f | |||
) | |||
exit /b 0 |
@ -1,27 +1,20 @@ | |||
SetLocal EnableDelayedExpansion | |||
taskkill /im msedge.exe /f | |||
cd "C:\Program Files (x86)\Microsoft\Edge\Application\" | |||
if exist 84.0.522.52 ( | |||
goto eight | |||
) | |||
if exist 9* ( | |||
goto nine | |||
) | |||
if exist 1* ( | |||
goto ten | |||
) | |||
cd "%PROGRAMFILES(x86)%\Microsoft\Edge\Application" | |||
:eight | |||
cd 84.0.522.52\Installer | |||
:nine | |||
cd 9*\Installer | |||
:ten | |||
cd 1*\Installer | |||
if exist "84.0.522.52" cd 84.0.522.52\Installer | |||
if exist "9*" cd 9*\Installer | |||
if exist "1*" cd 1*\Installer | |||
start setup.exe --uninstall --system-level --verbose-logging --force-uninstall | |||
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "FavoritesResolve" /t REG_BINARY /d 320300004C0000000114020000000000C0000000000000468300800020000000549E39A5246AD8012B113CA5246AD801A8B6C6DADDACD501970100000000000001000000000000000000000000000000A0013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016000E01320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00220000001E00EFBE02005500730065007200500069006E006E006500640000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C0000009B0000001C000000010000001C0000002D000000000000009A0000001100000003000000E4A63B761000000000433A5C55736572735C757365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C46696C65204578706C6F7265722E6C6E6B000060000000030000A058000000000000006465736B746F702D62356E36683339006E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A06E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A045000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000CE2181FCD4BF31408F25FF009E4345CA000000000000000000000000 /f | |||
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v Favorites /t REG_BINARY /d 00A40100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016001201320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C00260000001E00EFBE0200530079007300740065006D00500069006E006E006500640000001C000000FF /f | |||
@echo OFF | |||
for /f "usebackq tokens=2 delims=\" %%A in (`reg query "HKEY_USERS" ^| findstr /c:"S-"`) do ( | |||
reg query "HKU\%%A" | findstr /c:"Volatile Environment" /c:"AME_UserHive_" > NUL 2>&1 | |||
if not errorlevel 1 ( | |||
echo reg add "HKU\%%A\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "FavoritesResolve" /t REG_BINARY /d 320300004C0000000114020000000000C0000000000000468300800020000000549E39A5246AD8012B113CA5246AD801A8B6C6DADDACD501970100000000000001000000000000000000000000000000A0013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016000E01320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00220000001E00EFBE02005500730065007200500069006E006E006500640000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C0000009B0000001C000000010000001C0000002D000000000000009A0000001100000003000000E4A63B761000000000433A5C55736572735C757365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C46696C65204578706C6F7265722E6C6E6B000060000000030000A058000000000000006465736B746F702D62356E36683339006E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A06E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A045000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000CE2181FCD4BF31408F25FF009E4345CA000000000000000000000000 /f | |||
reg add "HKU\%%A\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v "FavoritesResolve" /t REG_BINARY /d 320300004C0000000114020000000000C0000000000000468300800020000000549E39A5246AD8012B113CA5246AD801A8B6C6DADDACD501970100000000000001000000000000000000000000000000A0013A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016000E01320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00220000001E00EFBE02005500730065007200500069006E006E006500640000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C0000009B0000001C000000010000001C0000002D000000000000009A0000001100000003000000E4A63B761000000000433A5C55736572735C757365725C417070446174615C526F616D696E675C4D6963726F736F66745C496E7465726E6574204578706C6F7265725C517569636B204C61756E63685C557365722050696E6E65645C5461736B4261725C46696C65204578706C6F7265722E6C6E6B000060000000030000A058000000000000006465736B746F702D62356E36683339006E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A06E1A1EE27BFFA94ABB0361D86F25337E500764DB17D6EC11A598000C2907D6A045000000090000A03900000031535053B1166D44AD8D7048A748402EA43D788C1D000000680000000048000000CE2181FCD4BF31408F25FF009E4345CA000000000000000000000000 /f | |||
echo reg add "HKU\%%A\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v Favorites /t REG_BINARY /d 00A40100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016001201320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C00260000001E00EFBE0200530079007300740065006D00500069006E006E006500640000001C000000FF /f | |||
reg add "HKU\%%A\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" /v Favorites /t REG_BINARY /d 00A40100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE1200000056F21270246AD8010F37A185246AD8012B113CA5246AD80114005600310000000000B154E29B11005461736B42617200400009000400EFBEB154C69BB154E29B2E000000F4940100000001000000000000000000000000000000D5BA89005400610073006B00420061007200000016001201320097010000874F0749200046494C4545587E312E4C4E4B00007C0009000400EFBEB154E29BB154E29B2E00000097900100000002000000000000000000520000000000589C4400460069006C00650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E0064006C006C002C002D003200320030003600370000001C00120000002B00EFBE2B113CA5246AD8011C00420000001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C006F0072006500720000001C00260000001E00EFBE0200530079007300740065006D00500069006E006E006500640000001C000000FF /f | |||
) | |||
) |
@ -1,4 +1,5 @@ | |||
cd Executables | |||
start /b /wait install_wim_tweak.exe /o /l | |||
start /b /wait install_wim_tweak.exe /o /c Microsoft-Windows-Internet-Browser-Package /r | |||
start /b /wait install_wim_tweak.exe /h /o /l |
@ -1,4 +0,0 @@ | |||
$wshell = New-Object -ComObject wscript.shell; | |||
$wshell.AppActivate('OldNewExplorer configuration') | |||
Sleep 1 | |||
$wshell.SendKeys('~') |
@ -0,0 +1,32 @@ | |||
cd Executables | |||
reg delete "HKLM\SOFTWARE\Clients\StartMenuInternet\IEXPLORE.EXE" /f | |||
@echo OFF | |||
for /f "usebackq tokens=2 delims=\" %%A in (`reg query "HKEY_USERS" ^| findstr /c:"S-"`) do ( | |||
REM If the "Volatile Environment" key exists, that means it is a proper user. Built in accounts/SIDs don't have this key. | |||
reg query "HKU\%%A" | findstr /c:"Volatile Environment"> NUL 2>&1 | |||
if not errorlevel 1 ( | |||
echo reg add "HKU\%%A\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "UserSignedIn" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%%A\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "UserSignedIn" /t REG_DWORD /d 1 /f | |||
PowerShell -NoP -ExecutionPolicy Bypass -File assoc.ps1 "%%A" "%%A" ".html:FirefoxHTML-308046B0AF4A39CB" ".htm:FirefoxHTML-308046B0AF4A39CB" "Proto:https:FirefoxURL-308046B0AF4A39CB" "Proto:http:FirefoxURL-308046B0AF4A39CB" ".3g2:VLC.3g2" ".3gp:VLC.3gp" ".3gp2:VLC.3gp2" ".3gpp:VLC.3gpp" ".aac:VLC.aac" ".adts:VLC.adts" ".aif:VLC.aif" ".aifc:VLC.aifc" ".aiff:VLC.aiff" ".amr:VLC.amr" ".asf:VLC.asf" ".asx:VLC.asx" ".au:VLC.au" ".avi:VLC.avi" ".bmp:JPEGView.exe" ".cda:VLC.cda" ".flac:VLC.flac" ".jpeg:JPEGView.exe" ".jpg:JPEGView.exe" ".m1v:VLC.m1v" ".m2t:VLC.m2t" ".m2ts:VLC.m2ts" ".m3u:VLC.m3u" ".m4a:VLC.m4a" ".m4p:VLC.m4p" ".m4v:VLC.m4v" ".mid:VLC.mid" ".mka:VLC.mka" ".mkv:VLC.mkv" ".mov:VLC.mov" ".MP2:VLC.mp2" ".mp2v:VLC.mp2v" ".mp3:VLC.mp3" ".mp4:VLC.mp4" ".mp4v:VLC.mp4v" ".mpa:VLC.mpa" ".MPE:VLC.mpe" ".mpeg:VLC.mpeg" ".mpg:VLC.mpg" ".mpv2:VLC.mpv2" ".mts:VLC.mts" ".png:JPEGView.exe" ".ra:VLC.ra" ".ram:VLC.ram" ".rmi:VLC.rmi" ".s3m:VLC.s3m" ".snd:VLC.snd" ".TS:VLC.ts" ".TTS:VLC.tts" ".voc:VLC.voc" ".wav:VLC.wav" ".webp:JPEGView.exe" ".wma:VLC.wma" ".wmv:VLC.wmv" ".WPL:VLC.wpl" ".wvx:VLC.wvx" ".xm:VLC.xm" ".zpl:VLC.zpl" | |||
) | |||
) | |||
for /f "usebackq tokens=4 delims=_" %%A in (`reg query "HKEY_USERS" ^| findstr /c:"AME_UserHive_"`) do ( | |||
for /f "usebackq tokens=7 delims=\" %%B in (`reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" ^| findstr /c:"S-"`) do ( | |||
for /f "usebackq tokens=2* delims= " %%C in (`reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%%B" ^| findstr /R /X /C:".*ProfileImagePath[ ]*REG_EXPAND_SZ[ ].*"`) do ( | |||
for /f "usebackq tokens=2* delims= " %%E in (`reg query "HKU\AME_UserHive_%%A\SOFTWARE\AME" ^| findstr /R /X /C:".*UserPath[ ]*REG_SZ[ ].*"`) do ( | |||
if "%%D"=="%%F" ( | |||
echo reg delete "HKU\AME_UserHive_%%A\SOFTWARE\AME" /f | |||
reg delete "HKU\AME_UserHive_%%A\SOFTWARE\AME" /f | |||
echo reg add "HKU\AME_UserHive_%%A\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "UserSignedIn" /t REG_DWORD /d 1 /f | |||
reg add "HKU\AME_UserHive_%%A\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "UserSignedIn" /t REG_DWORD /d 1 /f | |||
PowerShell -NoP -ExecutionPolicy Bypass -File assoc.ps1 "%%B" "AME_UserHive_%%A" ".html:FirefoxHTML-308046B0AF4A39CB" ".htm:FirefoxHTML-308046B0AF4A39CB" "Proto:https:FirefoxURL-308046B0AF4A39CB" "Proto:http:FirefoxURL-308046B0AF4A39CB" ".3g2:VLC.3g2" ".3gp:VLC.3gp" ".3gp2:VLC.3gp2" ".3gpp:VLC.3gpp" ".aac:VLC.aac" ".adts:VLC.adts" ".aif:VLC.aif" ".aifc:VLC.aifc" ".aiff:VLC.aiff" ".amr:VLC.amr" ".asf:VLC.asf" ".asx:VLC.asx" ".au:VLC.au" ".avi:VLC.avi" ".bmp:JPEGView.exe" ".cda:VLC.cda" ".flac:VLC.flac" ".jpeg:JPEGView.exe" ".jpg:JPEGView.exe" ".m1v:VLC.m1v" ".m2t:VLC.m2t" ".m2ts:VLC.m2ts" ".m3u:VLC.m3u" ".m4a:VLC.m4a" ".m4p:VLC.m4p" ".m4v:VLC.m4v" ".mid:VLC.mid" ".mka:VLC.mka" ".mkv:VLC.mkv" ".mov:VLC.mov" ".MP2:VLC.mp2" ".mp2v:VLC.mp2v" ".mp3:VLC.mp3" ".mp4:VLC.mp4" ".mp4v:VLC.mp4v" ".mpa:VLC.mpa" ".MPE:VLC.mpe" ".mpeg:VLC.mpeg" ".mpg:VLC.mpg" ".mpv2:VLC.mpv2" ".mts:VLC.mts" ".png:JPEGView.exe" ".ra:VLC.ra" ".ram:VLC.ram" ".rmi:VLC.rmi" ".s3m:VLC.s3m" ".snd:VLC.snd" ".TS:VLC.ts" ".TTS:VLC.tts" ".voc:VLC.voc" ".wav:VLC.wav" ".webp:JPEGView.exe" ".wma:VLC.wma" ".wmv:VLC.wmv" ".WPL:VLC.wpl" ".wvx:VLC.wvx" ".xm:VLC.xm" ".zpl:VLC.zpl" | |||
) | |||
) | |||
) | |||
) | |||
) |
@ -0,0 +1,195 @@ | |||
@echo OFF | |||
if not exist "%~dp0\AME-Firefox-Injection" ( | |||
echo. & echo No supplied AME-Firefox-Injection folder detected. | |||
exit /b 4 | |||
) | |||
:ENTRIES | |||
echo. & echo Grabbing previous Firefox entries... | |||
if not exist "%TEMP%\Firefox-Reg-Output.txt" echo No input entries detected & echo. & echo Generating random string... & goto GenRND | |||
setlocal EnableDelayedExpansion | |||
set /a "count1=0" | |||
for /f "usebackq tokens=2 delims=-" %%A in (`findstr /c:"Firefox-" "%TEMP%\Firefox-Reg-Output.txt"`) do ( | |||
set /a "count1=!count1!+1" | |||
set "ffBef!count1!=%%A" | |||
set "par=!par!)" | |||
set "arg=!arg!if not "%%D"=="%%A" (" | |||
) | |||
del /q /f "%TEMP%\Firefox-Reg-Output.txt" > NUL 2>&1 | |||
echo. & echo Comparing Firefox entries... | |||
set /a "count2=0" | |||
for /f "usebackq tokens=2 delims=-" %%D in (`reg query "HKLM\SOFTWARE\Clients\StartMenuInternet" /f "Firefox-"`) do ( | |||
set /a "count2=!count2!+1" | |||
%arg%set "NewCode=%%D"%par% | |||
) | |||
if "%count1%"=="0" (if "%count2%"=="0" (set "NewCode=NULL")) | |||
endlocal & set "NewCode=%NewCode%" | |||
:CHECKS | |||
set "RunEC=10" | |||
set /a "count0=1" | |||
for /f "usebackq tokens=2 delims=\" %%A in (`reg query "HKEY_USERS" ^| findstr /c:"S-" /c:"AME_UserHive_"`) do ( | |||
for /f "usebackq tokens=2* delims= " %%B in (`reg query "HKU\%%A\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "AppData" 2^>^&1 ^| findstr /R /X /C:".*AppData[ ]*REG_SZ[ ].*"`) do ( | |||
call :AFISCALL "%%C" | |||
if errorlevel 2 set "RunEC=2" | |||
if errorlevel 1 set "RunEC=1" | |||
if errorlevel 0 set "RunEC=0" | |||
) | |||
) | |||
exit /b %RunEC% | |||
:AFISCALL | |||
setlocal | |||
echo. & echo Generating random string... | |||
:GenRND | |||
setlocal EnableDelayedExpansion | |||
set "RNDConsist=abcdefghijklmnopqrstuvwxyz0123456789" | |||
set /a "RND=%RANDOM% %% 36" | |||
set "RNDStr=!RNDStr!!RNDConsist:~%RND%,1!" | |||
if "%RNDStr:~7%"=="" (goto GenRND) | |||
endlocal & set "RNDStr=%RNDStr%" | |||
:: Redundancy, incase the original Firefox installed check fails | |||
if "%NewCode%"=="NULL" echo. & echo No Firefox install detected & goto PREFSONLY | |||
if "%NewCode%"=="" echo. & echo Firefox version already installed & goto PREFSONLY | |||
if not EXIST "%PROGRAMFILES%\Mozilla Firefox\firefox.exe" echo. & echo Can't find Firefox.exe & goto PREFSONLY | |||
if exist "%~1\Mozilla\Firefox\profiles.ini" ( | |||
findstr /c:"%NewCode%" "%~1\Mozilla\Firefox\profiles.ini" > NUL 2>&1 | |||
if not errorlevel 1 echo. & echo Firefox version already in profiles.ini & goto PREFSONLY | |||
) | |||
:PROFILENAME | |||
if %count0% GTR 50 echo. & echo Default-release count exceeded 50 & goto PREFSONLY | |||
if exist "%~1\Mozilla\Firefox\profiles.ini" ( | |||
findstr /c:"Name=default-release" "%~1\Mozilla\Firefox\profiles.ini" > NUL 2>&1 | |||
if not errorlevel 1 ( | |||
findstr /c:"Name=default-release-%count0%" "%~1\Mozilla\Firefox\profiles.ini" | |||
if not errorlevel 1 ( | |||
set /a "count0=%count0%+1" | |||
goto PROFILENAME | |||
) else ( | |||
set "profileName=default-release-%count0%" | |||
) | |||
) else ( | |||
set "profileName=default-release" | |||
) | |||
) else ( | |||
set "profileName=default-release" | |||
) | |||
echo. & echo Injecting profile... | |||
@echo ON | |||
:: This could also be set manually in the profiles.ini file | |||
mkdir "%~1\Mozilla\Firefox\Profiles\%RNDStr%.%profileName%" | |||
robocopy "%~dp0\AME-Firefox-Injection" "%~1\Mozilla\Firefox\Profiles\%RNDStr%.%profileName%" /E > NUL | |||
:: Sets profile as the default | |||
echo [Install%NewCode%]>> "%~1\Mozilla\Firefox\profiles.ini" | |||
echo Default=Profiles/%RNDStr%.%profileName%>> "%~1\Mozilla\Firefox\profiles.ini" | |||
echo Locked=^1>> "%~1\Mozilla\Firefox\profiles.ini" | |||
echo.>> "%~1\Mozilla\Firefox\profiles.ini" | |||
echo [Profile0]>> "%~1\Mozilla\Firefox\profiles.ini" | |||
echo Name=%profileName%>> "%~1\Mozilla\Firefox\profiles.ini" | |||
echo IsRelative=^1>> "%~1\Mozilla\Firefox\profiles.ini" | |||
echo Path=Profiles/%RNDStr%.%profileName%>> "%~1\Mozilla\Firefox\profiles.ini" | |||
:: Add prefs to any other Firefox profiles in all users | |||
@echo OFF | |||
for /f "usebackq delims=" %%B in (`dir /B /A:d "%~1\Mozilla\Firefox\Profiles" ^| findstr /v /x /c:"%RNDStr%.%profileName%"`) do ( | |||
if exist "%~1\Mozilla\Firefox\Profiles\%%B\prefs.js" ( | |||
:: Removes lines containing these entries from the profiles prefs.js. This way any old prefs don't overlap with the new prefs | |||
echo findstr /V /C:""""app.shield.optoutstudies.enabled"""" /C:""""browser.aboutwelcome.enabled"""" /C:""""browser.disableResetPrompt"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features"""" /C:""""browser.newtabpage.activity-stream.feeds.section.topstories"""" /C:""""browser.newtabpage.activity-stream.feeds.topsites"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includePocket"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includeVisited"""" /C:""""browser.newtabpage.activity-stream.showSponsored"""" /C:""""browser.newtabpage.activity-stream.showSponsoredTopSites"""" /C:""""browser.urlbar.placeholderNam"""" /C:""""browser.urlbar.suggest.quicksuggest.nonsponsored"""" /C:""""browser.urlbar.suggest.quicksuggest.sponsored"""" /C:""""browser.urlbar.suggest.topsites"""" /C:""""datareporting.healthreport.uploadEnabled"""" /C:""""dom.security.https_only_mode"""" /C:""""dom.security.https_only_mode_ever_enabled"""" "%~1\Mozilla\Firefox\Profiles\%%B\prefs.js "^>^> "%TEMP%\prefs.js.tmp" | |||
findstr /V /C:""""app.shield.optoutstudies.enabled"""" /C:""""browser.aboutwelcome.enabled"""" /C:""""browser.disableResetPrompt"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features"""" /C:""""browser.newtabpage.activity-stream.feeds.section.topstories"""" /C:""""browser.newtabpage.activity-stream.feeds.topsites"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includePocket"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includeVisited"""" /C:""""browser.newtabpage.activity-stream.showSponsored"""" /C:""""browser.newtabpage.activity-stream.showSponsoredTopSites"""" /C:""""browser.urlbar.placeholderNam"""" /C:""""browser.urlbar.suggest.quicksuggest.nonsponsored"""" /C:""""browser.urlbar.suggest.quicksuggest.sponsored"""" /C:""""browser.urlbar.suggest.topsites"""" /C:""""datareporting.healthreport.uploadEnabled"""" /C:""""dom.security.https_only_mode"""" /C:""""dom.security.https_only_mode_ever_enabled"""" "%~1\Mozilla\Firefox\Profiles\%%B\prefs.js ">> "%TEMP%\prefs.js.tmp" | |||
) | |||
:: Filters out a few prefs from AME-Firefox-Injectiont\prefs.js and adds them to prefs.js.tmp | |||
echo findstr /V /C:""""browser.toolbars.bookmarks.visibility"""" /C:""""extensions.webextensions.uuids"""" /C:""""extensions.webextensions.uuids"""" "%~dp0\AME-Firefox-Injection\prefs.js"^>^> "%TEMP%\prefs.js.tmp" | |||
findstr /V /C:""""browser.toolbars.bookmarks.visibility"""" /C:""""extensions.webextensions.uuids"""" /C:""""extensions.webextensions.uuids"""" "%~dp0\AME-Firefox-Injection\prefs.js">> "%TEMP%\prefs.js.tmp" | |||
echo move /y "%TEMP%\prefs.js.tmp" "%~1\Mozilla\Firefox\Profiles\%%B\prefs.js" | |||
move /y "%TEMP%\prefs.js.tmp" "%~1\Mozilla\Firefox\Profiles\%%B\prefs.js" | |||
if exist "%~1\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4" echo del /Q /F "%~1\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4" & del /Q /F "%~1\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4" | |||
echo robocopy "%~dp0\AME-Firefox-Injection" "%~1\Mozilla\Firefox\Profiles\%%B" search.json.mozlz4 /E ^> NUL | |||
robocopy "%~dp0\AME-Firefox-Injection" "%~1\Mozilla\Firefox\Profiles\%%B" search.json.mozlz4 /E > NUL | |||
echo PowerShell -NoP -C "%~1\Mozilla\Firefox\Profiles' | Set-Acl '%~1\Mozilla\Firefox\Profiles\%%B\prefs.js'" ^> NUL 2^>^&1 | |||
PowerShell -NoP -C "%~1\Mozilla\Firefox\Profiles' | Set-Acl '%~1\Mozilla\Firefox\Profiles\%%B\prefs.js'" > NUL 2>&1 | |||
echo PowerShell -NoP -C "Get-Acl '%~1\Mozilla\Firefox\Profiles' | Set-Acl '%~1\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4'" ^> NUL 2^>^&1 | |||
PowerShell -NoP -C "Get-Acl '%~1\Mozilla\Firefox\Profiles' | Set-Acl '%~1\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4'" > NUL 2>&1 | |||
) | |||
echo. & echo Successfully injected custom Firefox configs. | |||
endlocal & exit /b 0 | |||
:PREFSONLY | |||
:: uBlock Origin could be installed automatically here, however that would involve overwriting the old extension.json etc | |||
:: files, which, if the user had previous extensions, could cause issues. | |||
@echo. & echo Injecting config files... | |||
if exist "%TEMP%\prefs.js.tmp" del /q /f "%TEMP%\prefs.js.tmp" > NUL | |||
set /a "count3=0" | |||
@echo OFF | |||
for /f "usebackq delims=" %%A in (`dir /B /A:d "%~1\Mozilla\Firefox\Profiles"`) do ( | |||
set /a "count3=%count3%+1" | |||
if exist "%~1\Mozilla\Firefox\Profiles\%%A\prefs.js" ( | |||
:: Removes lines containing these entries from the profiles prefs.js. This way any old prefs don't overlap with the new prefs | |||
echo findstr /V /C:""""app.shield.optoutstudies.enabled"""" /C:""""browser.aboutwelcome.enabled"""" /C:""""browser.disableResetPrompt"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features"""" /C:""""browser.newtabpage.activity-stream.feeds.section.topstories"""" /C:""""browser.newtabpage.activity-stream.feeds.topsites"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includePocket"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includeVisited"""" /C:""""browser.newtabpage.activity-stream.showSponsored"""" /C:""""browser.newtabpage.activity-stream.showSponsoredTopSites"""" /C:""""browser.urlbar.placeholderNam"""" /C:""""browser.urlbar.suggest.quicksuggest.nonsponsored"""" /C:""""browser.urlbar.suggest.quicksuggest.sponsored"""" /C:""""browser.urlbar.suggest.topsites"""" /C:""""datareporting.healthreport.uploadEnabled"""" /C:""""dom.security.https_only_mode"""" /C:""""dom.security.https_only_mode_ever_enabled"""" "%~1\Mozilla\Firefox\Profiles\%%A\prefs.js "^>^> "%TEMP%\prefs.js.tmp" | |||
findstr /V /C:""""app.shield.optoutstudies.enabled"""" /C:""""browser.aboutwelcome.enabled"""" /C:""""browser.disableResetPrompt"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features"""" /C:""""browser.newtabpage.activity-stream.feeds.section.topstories"""" /C:""""browser.newtabpage.activity-stream.feeds.topsites"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includePocket"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includeVisited"""" /C:""""browser.newtabpage.activity-stream.showSponsored"""" /C:""""browser.newtabpage.activity-stream.showSponsoredTopSites"""" /C:""""browser.urlbar.placeholderNam"""" /C:""""browser.urlbar.suggest.quicksuggest.nonsponsored"""" /C:""""browser.urlbar.suggest.quicksuggest.sponsored"""" /C:""""browser.urlbar.suggest.topsites"""" /C:""""datareporting.healthreport.uploadEnabled"""" /C:""""dom.security.https_only_mode"""" /C:""""dom.security.https_only_mode_ever_enabled"""" "%~1\Mozilla\Firefox\Profiles\%%A\prefs.js ">> "%TEMP%\prefs.js.tmp" | |||
) | |||
:: Filters out a few prefs from AME-Firefox-Injectiont\prefs.js and adds them to prefs.js.tmp | |||
echo findstr /V /C:""""browser.toolbars.bookmarks.visibility"""" /C:""""extensions.webextensions.uuids"""" /C:""""extensions.webextensions.uuids"""" "%~dp0\AME-Firefox-Injection\prefs.js"^>^> "%TEMP%\prefs.js.tmp" | |||
findstr /V /C:""""browser.toolbars.bookmarks.visibility"""" /C:""""extensions.webextensions.uuids"""" /C:""""extensions.webextensions.uuids"""" "%~dp0\AME-Firefox-Injection\prefs.js">> "%TEMP%\prefs.js.tmp" | |||
echo move /y "%TEMP%\prefs.js.tmp" "%~1\Mozilla\Firefox\Profiles\%%A\prefs.js" | |||
move /y "%TEMP%\prefs.js.tmp" "%~1\Mozilla\Firefox\Profiles\%%A\prefs.js" | |||
if exist "%~1\Mozilla\Firefox\Profiles\%%A\search.json.mozlz4" echo del /Q /F "%~1\Mozilla\Firefox\Profiles\%%A\search.json.mozlz4" & del /Q /F "%~1\Mozilla\Firefox\Profiles\%%A\search.json.mozlz4" | |||
echo robocopy "%~dp0\AME-Firefox-Injection" "%~1\Mozilla\Firefox\Profiles\%%A" search.json.mozlz4 /E ^> NUL | |||
robocopy "%~dp0\AME-Firefox-Injection" "%~1\Mozilla\Firefox\Profiles\%%A" search.json.mozlz4 /E > NUL | |||
) | |||
for /f "usebackq delims=" %%A in (`dir /B /A:d "%SYSTEMDRIVE%\Users"`) do ( | |||
if exist "%~1\Mozilla\Firefox\Profiles" ( | |||
for /f "usebackq delims=" %%B in (`dir /B /A:d "%~1\Mozilla\Firefox\Profiles"`) do ( | |||
set /a "count3=%count3%+1" | |||
if exist "%~1\Mozilla\Firefox\Profiles\%%B\prefs.js" ( | |||
:: Removes lines containing these entries from the profiles prefs.js. This way any old prefs don't overlap with the new prefs | |||
echo findstr /V /C:""""app.shield.optoutstudies.enabled"""" /C:""""browser.aboutwelcome.enabled"""" /C:""""browser.disableResetPrompt"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features"""" /C:""""browser.newtabpage.activity-stream.feeds.section.topstories"""" /C:""""browser.newtabpage.activity-stream.feeds.topsites"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includePocket"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includeVisited"""" /C:""""browser.newtabpage.activity-stream.showSponsored"""" /C:""""browser.newtabpage.activity-stream.showSponsoredTopSites"""" /C:""""browser.urlbar.placeholderNam"""" /C:""""browser.urlbar.suggest.quicksuggest.nonsponsored"""" /C:""""browser.urlbar.suggest.quicksuggest.sponsored"""" /C:""""browser.urlbar.suggest.topsites"""" /C:""""datareporting.healthreport.uploadEnabled"""" /C:""""dom.security.https_only_mode"""" /C:""""dom.security.https_only_mode_ever_enabled"""" "%~1\Mozilla\Firefox\Profiles\%%B\prefs.js "^>^> "%TEMP%\prefs.js.tmp" | |||
findstr /V /C:""""app.shield.optoutstudies.enabled"""" /C:""""browser.aboutwelcome.enabled"""" /C:""""browser.disableResetPrompt"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons"""" /C:""""browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features"""" /C:""""browser.newtabpage.activity-stream.feeds.section.topstories"""" /C:""""browser.newtabpage.activity-stream.feeds.topsites"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includePocket"""" /C:""""browser.newtabpage.activity-stream.section.highlights.includeVisited"""" /C:""""browser.newtabpage.activity-stream.showSponsored"""" /C:""""browser.newtabpage.activity-stream.showSponsoredTopSites"""" /C:""""browser.urlbar.placeholderNam"""" /C:""""browser.urlbar.suggest.quicksuggest.nonsponsored"""" /C:""""browser.urlbar.suggest.quicksuggest.sponsored"""" /C:""""browser.urlbar.suggest.topsites"""" /C:""""datareporting.healthreport.uploadEnabled"""" /C:""""dom.security.https_only_mode"""" /C:""""dom.security.https_only_mode_ever_enabled"""" "%~1\Mozilla\Firefox\Profiles\%%B\prefs.js ">> "%TEMP%\prefs.js.tmp" | |||
) | |||
:: Filters out a few prefs from AME-Firefox-Injectiont\prefs.js and adds them to prefs.js.tmp | |||
echo findstr /V /C:""""browser.toolbars.bookmarks.visibility"""" /C:""""extensions.webextensions.uuids"""" /C:""""extensions.webextensions.uuids"""" "%~dp0\AME-Firefox-Injection\prefs.js"^>^> "%TEMP%\prefs.js.tmp" | |||
findstr /V /C:""""browser.toolbars.bookmarks.visibility"""" /C:""""extensions.webextensions.uuids"""" /C:""""extensions.webextensions.uuids"""" "%~dp0\AME-Firefox-Injection\prefs.js">> "%TEMP%\prefs.js.tmp" | |||
echo move /y "%TEMP%\prefs.js.tmp" "%~1\Mozilla\Firefox\Profiles\%%B\prefs.js" | |||
move /y "%TEMP%\prefs.js.tmp" "%~1\Mozilla\Firefox\Profiles\%%B\prefs.js" | |||
if exist "%~1\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4" echo del /Q /F "%~1\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4" & del /Q /F "%~1\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4" | |||
echo robocopy "%~dp0\AME-Firefox-Injection" "%~1\Mozilla\Firefox\Profiles\%%B" search.json.mozlz4 /E ^> NUL | |||
robocopy "%~dp0\AME-Firefox-Injection" "%~1\Mozilla\Firefox\Profiles\%%B" search.json.mozlz4 /E > NUL | |||
echo PowerShell -NoP -C "Get-Acl '%~1\Mozilla\Firefox\Profiles' | Set-Acl '%~1\Mozilla\Firefox\Profiles\%%B\prefs.js'" ^> NUL 2^>^&1 | |||
PowerShell -NoP -C "Get-Acl '%~1\Mozilla\Firefox\Profiles' | Set-Acl '%~1\Mozilla\Firefox\Profiles\%%B\prefs.js'" > NUL 2>&1 | |||
echo PowerShell -NoP -C "Get-Acl '%~1\Mozilla\Firefox\Profiles' | Set-Acl '%~1\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4'" ^> NUL 2^>^&1 | |||
PowerShell -NoP -C "Get-Acl '%~1\Mozilla\Firefox\Profiles' | Set-Acl '%~1\Mozilla\Firefox\Profiles\%%B\search.json.mozlz4'" > NUL 2>&1 | |||
) | |||
) | |||
) | |||
if %count3% EQU 0 ( | |||
echo. & echo Failed! No profiles detected | |||
endlocal & exit /b 2 | |||
) else ( | |||
echo. & echo Successfully injected custom Firefox configs. | |||
endlocal & exit /b 1 | |||
) |
@ -1,2 +0,0 @@ | |||
cd Executables | |||
setdefaultbrowser.exe HKLM Firefox-308046B0AF4A39CB |
@ -0,0 +1,16 @@ | |||
<LayoutModificationTemplate xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" Version="1" xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification"> | |||
<LayoutOptions StartTileGroupCellWidth="6" /> | |||
<DefaultLayoutOverride> | |||
<StartLayoutCollection> | |||
<defaultlayout:StartLayout GroupCellWidth="6" /> | |||
</StartLayoutCollection> | |||
</DefaultLayoutOverride> | |||
<CustomTaskbarLayoutCollection PinListPlacement="Replace"> | |||
<defaultlayout:TaskbarLayout> | |||
<taskbar:TaskbarPinList> | |||
<taskbar:DesktopApp DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\File Explorer.lnk" /> | |||
<taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Firefox.lnk" /> | |||
</taskbar:TaskbarPinList> | |||
</defaultlayout:TaskbarLayout> | |||
</CustomTaskbarLayoutCollection> | |||
</LayoutModificationTemplate> |
@ -1,3 +0,0 @@ | |||
cd Executables | |||
schtasks /create /xml AME-Log-off-admin.xml /tn "AME Log-off admin" /ru administrator /it | |||
schtasks /create /xml AME-Log-off-admin-message.xml /tn "AME Log-off admin message" /ru administrator /it |
@ -1 +1 @@ | |||
%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe /uninstall | |||
PowerShell -NoP -C "Start-Process '%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe' -ArgumentList '/uninstall' -NoNewWindow" |
@ -1,4 +1,5 @@ | |||
cd .\Executables | |||
python-3.9.7-amd64.exe /quiet InstallAllUsers=1 | |||
start NSudoLC.exe -U:S -P:E -M:S -Priority:RealTime -Wait SECUI.bat | |||
@powershell -NoProfile -ExecutionPolicy Bypass -Command "Get-AppxPackage -all *Microsoft.Windows.SecHealthUI* | Remove-AppPackage -AllUsers" | |||
cd Executables | |||
python-3.9.7-amd64.exe /quiet InstallAllUsers=1 TargetDir="%PROGRAMFILES%\Python39" | |||
NSudoLC -U:S -P:E -M:S -Priority:RealTime -UseCurrentConsole -Wait PowerShell -NoP -C "Start-Process '%PROGRAMFILES%\Python39\python.exe' -ArgumentList 'remove_SecHealthUI_stub.py' -NoNewWindow" | |||
PowerShell -NoP -ExecutionPolicy Bypass -Command "Get-AppxPackage -All *Microsoft.Windows.SecHealthUI* | Remove-AppPackage -AllUsers" |
@ -1 +0,0 @@ | |||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\Gather\Windows\SystemIndex" /v "EnableFindMyFiles" /t REG_DWORD /d 1 /f |
@ -1 +0,0 @@ | |||
"C:\Program Files\Python39\python.exe" remove_SecHealthUI_stub.py |
@ -0,0 +1,69 @@ | |||
@echo OFF | |||
:sfcCmdChecks | |||
if not exist "%~dp0\sfc.cmd" ( | |||
echo. & echo No supplied sfc.cmd detected | |||
exit /b 2 | |||
) | |||
if exist "%SYSTEMROOT%\System32\sfc.cmd" ( | |||
echo takeown /f "%SYSTEMROOT%\System32\sfc.cmd" /a | |||
takeown /f "%SYSTEMROOT%\System32\sfc.cmd" /a | |||
echo icacls "%SYSTEMROOT%\System32\sfc.cmd" /grant Administrators:F | |||
icacls "%SYSTEMROOT%\System32\sfc.cmd" /grant Administrators:F | |||
echo del /q /f "%SYSTEMROOT%\System32\sfc.cmd" | |||
del /q /f "%SYSTEMROOT%\System32\sfc.cmd" | |||
goto move | |||
) else ( | |||
goto move | |||
) | |||
:move | |||
@echo on | |||
move /y "%~dp0\sfc.cmd" "%SYSTEMROOT%\System32\" 1> NUL | |||
:sfc1ExeCheck | |||
@echo OFF | |||
if exist "%SYSTEMROOT%\System32\sfc1.exe" ( | |||
echo sfc1.exe already exists, assigning permissions... & echo. | |||
echo PowerShell -NoP -C "Get-Acl '%SYSTEMROOT%\System32\diskmgmt.msc' | Set-Acl '%SYSTEMROOT%\System32\sfc1.exe'" ^> NUL 2^>^&1 | |||
PowerShell -NoP -C "Get-Acl '%SYSTEMROOT%\System32\diskmgmt.msc' | Set-Acl '%SYSTEMROOT%\System32\sfc1.exe'" > NUL 2>&1 | |||
echo PowerShell -NoP -C "Get-Acl '%SYSTEMROOT%\System32\diskmgmt.msc' | Set-Acl '%SYSTEMROOT%\System32\sfc.cmd'" ^> NUL 2^>^&1 | |||
PowerShell -NoP -C "Get-Acl '%SYSTEMROOT%\System32\diskmgmt.msc' | Set-Acl '%SYSTEMROOT%\System32\sfc.cmd'" > NUL 2>&1 | |||
@echo OFF | |||
goto complete | |||
) else ( | |||
goto managePermissions | |||
) | |||
:managePermissions | |||
echo Assigning permissions and renaming sfc.exe... & echo. | |||
@echo ON | |||
:: Copies the ACL from diskmgmt.msc to sfc.cmd. | |||
PowerShell -NoP -C "Get-Acl '%SYSTEMROOT%\System32\diskmgmt.msc' | Set-Acl '%SYSTEMROOT%\System32\sfc.cmd'" > NUL 2>&1 | |||
:: Gives the Administrator group full access for renaming sfc.exe to sfc1.exe. | |||
takeown /f "%SYSTEMROOT%\System32\sfc.exe" /a > NUL 2>&1 | |||
icacls "%SYSTEMROOT%\System32\sfc.exe" /grant Administrators:F > NUL 2>&1 | |||
goto renameSFCExe | |||
:renameSFCExe | |||
rename "%SYSTEMROOT%\System32\sfc.exe" "sfc1.exe" > NUL 2>&1 | |||
:: Copies the ACL from diskmgmt.msc to sfc1.exe. Essentially resetting its ACL. | |||
PowerShell -NoP -C "Get-Acl '%SYSTEMROOT%\System32\diskmgmt.msc' | Set-Acl '%SYSTEMROOT%\System32\sfc1.exe'" > NUL 2>&1 | |||
goto complete | |||
:complete | |||
@echo Successfully deployed sfc modification. | |||
@exit /b 0 |
@ -1,28 +1,20 @@ | |||
cd Executables | |||
mkdir "C:\Users\%username%\AppData\Roaming\OpenShell" | |||
mkdir "C:\Users\%username%\AppData\Roaming\OpenShell\Pinned" | |||
@echo OFF | |||
for /f "usebackq delims=" %%A in (`dir /B /A:d "%SYSTEMDRIVE%\Users" ^| findstr /V /I /X /c:"Public" /c:"Default User" /c:"Default" /c:"All Users"`) do ( | |||
echo mkdir "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\OpenShell" | |||
mkdir "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\OpenShell" | |||
echo mkdir "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\OpenShell\Pinned" | |||
mkdir "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\OpenShell\Pinned" | |||
copy "Firefox.lnk" "C:\Users\%username%\AppData\Roaming\OpenShell\Pinned\" | |||
copy "Mozilla Thunderbird.lnk" "C:\Users\%username%\AppData\Roaming\OpenShell\Pinned\" | |||
echo PowerShell -NoP -C "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut('%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\OpenShell\Pinned\Windows Terminal.lnk'); $S.TargetPath = '%PROGRAMFILES%\Scoop\GlobalScoopApps\apps\windows-terminal\current\WindowsTerminal.exe'; $S.Save(); $s = $ws.CreateShortcut('%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\OpenShell\Pinned\Mozilla Thunderbird.lnk'); $S.TargetPath = '%HOMEDRIVE%\Program Files\Mozilla Thunderbird\thunderbird.exe'; $S.WorkingDirectory = 'C:\Program Files\Mozilla Thunderbird'; $S.Save(); $s = $ws.CreateShortcut('%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\OpenShell\Pinned\Firefox.lnk'); $S.TargetPath = '%HOMEDRIVE%\Program Files\Mozilla Firefox\firefox.exe'; $S.WorkingDirectory = 'C:\Program Files\Mozilla Firefox'; $S.Save()" | |||
PowerShell -NoP -C "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut('%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\OpenShell\Pinned\Windows Terminal.lnk'); $S.TargetPath = '%PROGRAMFILES%\Scoop\GlobalScoopApps\apps\windows-terminal\current\WindowsTerminal.exe'; $S.Save(); $s = $ws.CreateShortcut('%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\OpenShell\Pinned\Mozilla Thunderbird.lnk'); $S.TargetPath = '%HOMEDRIVE%\Program Files\Mozilla Thunderbird\thunderbird.exe'; $S.WorkingDirectory = 'C:\Program Files\Mozilla Thunderbird'; $S.Save(); $s = $ws.CreateShortcut('%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\OpenShell\Pinned\Firefox.lnk'); $S.TargetPath = '%HOMEDRIVE%\Program Files\Mozilla Firefox\firefox.exe'; $S.WorkingDirectory = 'C:\Program Files\Mozilla Firefox'; $S.Save()" | |||
SETLOCAL ENABLEDELAYEDEXPANSION | |||
SET LinkName=Windows Terminal | |||
SET Esc_LinkDest=%%HOMEDRIVE%%\Users\%username%\AppData\Roaming\OpenShell\Pinned\!LinkName!.lnk | |||
SET Esc_LinkTarget=%%HOMEDRIVE%%\Users\%username%\scoop\apps\windows-terminal\current\WindowsTerminal.exe | |||
SET cSctVBS=CreateShortcut.vbs | |||
( | |||
echo Set oWS = WScript.CreateObject^("WScript.Shell"^) | |||
echo sLinkFile = oWS.ExpandEnvironmentStrings^("!Esc_LinkDest!"^) | |||
echo Set oLink = oWS.CreateShortcut^(sLinkFile^) | |||
echo oLink.TargetPath = oWS.ExpandEnvironmentStrings^("!Esc_LinkTarget!"^) | |||
echo oLink.Save | |||
)1>!cSctVBS! | |||
cscript //nologo .\!cSctVBS! | |||
DEL !cSctVBS! /f /q | |||
echo del /q /f "%SYSTEMDRIVE%\Users\%%A\Desktop\Microsoft Edge.lnk" | |||
del /q /f "%SYSTEMDRIVE%\Users\%%A\Desktop\Microsoft Edge.lnk" | |||
echo del /q /f "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk" | |||
del /q /f "%SYSTEMDRIVE%\Users\%%A\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk" | |||
) | |||
copy "Windows Terminal.lnk" "C:\Users\%username%\AppData\Roaming\OpenShell\Pinned\" | |||
del /f /q "C:\Users\%username%\Desktop\Microsoft Edge.lnk" | |||
del /f /q "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk" | |||
del /f /q "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Windows Media Player.lnk" | |||
@echo ON | |||
del /q /f "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Accessories\Windows Media Player.lnk" |
@ -1,31 +1,67 @@ | |||
cd Executables | |||
@echo OFF | |||
if exist OldCalculatorforWindows10Cfg.exe ( | |||
del OldCalculatorforWindows10Cfg.exe /f /q | |||
echo del /q /f OldCalculatorforWindows10Cfg.exe | |||
del /q /f OldCalculatorforWindows10Cfg.exe | |||
echo del /q /f readme.txt | |||
del /q /f readme.txt | |||
echo rmdir /q /s "silent_installers" | |||
rmdir /q /s "silent_installers" | |||
echo rmdir /q /s "OldNewExplorer" | |||
rmdir /q /s "OldNewExplorer" | |||
echo rmdir /q /s "%ALLUSERSPROFILE%\OldNewExplorer | |||
rmdir /q /s "%ALLUSERSPROFILE%\OldNewExplorer | |||
) | |||
@echo ON | |||
7za.exe e silent_installers.7z -pwizard | |||
mkdir "%ALLUSERSPROFILE%\OldNewExplorer" | |||
move /y OldNewExplorer32.dll "%ALLUSERSPROFILE%\OldNewExplorer" | |||
move /y OldNewExplorer64.dll "%ALLUSERSPROFILE%\OldNewExplorer" | |||
move /y OldNewExplorerCfg.exe "%ALLUSERSPROFILE%\OldNewExplorer" | |||
icacls "%ALLUSERSPROFILE%\OldNewExplorer" /reset /t | |||
NSudoLC -U:S -P:E -M:S -Priority:RealTime -UseCurrentConsole -Wait cmd /c "del /q /f """"%WINDIR%\System32\calc.exe""""" | |||
PowerShell -NoP -C "Invoke-WMIMethod -Class Win32_Process -Name Create -ArgumentList '%~dp0\OldCalculatorforWindows10Cfg.exe'" | |||
NSudoLC -U:E -P:E -M:S -Priority:RealTime -UseCurrentConsole -Wait PowerShell -NoP -C "Start-Process '%ALLUSERSPROFILE%\OldNewExplorer\OldNewExplorerCfg.exe' -WorkingDirectory '%ALLUSERSPROFILE%\OldNewExplorer'; Sleep 2; $wshell = New-Object -ComObject wscript.shell; $wshell.AppActivate('OldNewExplorer configuration'); Sleep 1; $wshell.SendKeys('~'); Sleep 8; taskkill /im OldNewExplorerCfg.exe" | |||
if exist OldNewExplorerCfg.exe ( | |||
del OldNewExplorerCfg.exe /f /q | |||
@echo OFF | |||
if exist "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Accessories\Old Calculator.lnk" ( | |||
echo rename "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Accessories\Old Calculator.lnk" "Calculator.lnk" | |||
rename "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Accessories\Old Calculator.lnk" "Calculator.lnk" | |||
) else ( | |||
echo timeout /t 10 ^> NUL | |||
timeout /t 10 > NUL | |||
if exist "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Accessories\Old Calculator.lnk" echo rename "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Accessories\Old Calculator.lnk" "Calculator.lnk" & rename "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Accessories\Old Calculator.lnk" "Calculator.lnk" | |||
) | |||
.\7za.exe e .\silent_installers.7z -pwizard | |||
::Install Old Calculator For Windows 10 | |||
start OldCalculatorforWindows10Cfg.exe | |||
timeout /t 15 | |||
::Install OldNewExplorer | |||
start OldNewExplorerCfg.exe | |||
@powershell -NoProfile -ExecutionPolicy Bypass -File Enter.ps1 | |||
timeout /t 15 | |||
taskkill /im OldNewExplorerCfg.exe | |||
::Configure OldNewExplorer | |||
reg add HKEY_CURRENT_USER\SOFTWARE\Tihiy\OldNewExplorer /v Details /t REG_DWORD /d 1 /f | |||
reg add HKEY_CURRENT_USER\SOFTWARE\Tihiy\OldNewExplorer /v DriveGrouping /t REG_DWORD /d 1 /f | |||
reg add HKEY_CURRENT_USER\SOFTWARE\Tihiy\OldNewExplorer /v HideFolders /t REG_DWORD /d 1 /f | |||
reg add HKEY_CURRENT_USER\SOFTWARE\Tihiy\OldNewExplorer /v IEButtons /t REG_DWORD /d 0 /f | |||
reg add HKEY_CURRENT_USER\SOFTWARE\Tihiy\OldNewExplorer /v NavBarGlass /t REG_DWORD /d 0 /f | |||
reg add HKEY_CURRENT_USER\SOFTWARE\Tihiy\OldNewExplorer /v NoCaption /t REG_DWORD /d 1 /f | |||
reg add HKEY_CURRENT_USER\SOFTWARE\Tihiy\OldNewExplorer /v NoIcon /t REG_DWORD /d 1 /f | |||
reg add HKEY_CURRENT_USER\SOFTWARE\Tihiy\OldNewExplorer /v NoRibbon /t REG_DWORD /d 1 /f | |||
reg add HKEY_CURRENT_USER\SOFTWARE\Tihiy\OldNewExplorer /v NoUpButton /t REG_DWORD /d 0 /f | |||
for /f "usebackq tokens=2 delims=\" %%A in (`reg query "HKEY_USERS" ^| findstr /c:"S-" /c:"AME_UserHive_"`) do ( | |||
REM If the "Volatile Environment" key exists, that means it is a proper user. Built in accounts/SIDs don't have this key. | |||
reg query "HKU\%%A" | findstr /c:"Volatile Environment" /c:"AME_UserHive_" > NUL 2>&1 | |||
if not errorlevel 1 call :SLNTCALL "%%A" | |||
) | |||
exit /b 0 | |||
:SLNTCALL | |||
@echo ON | |||
::Configure OldNewExplorer" | |||
reg add "HKU\%~1\SOFTWARE\Tihiy" /f | |||
reg add "HKU\%~1\SOFTWARE\Tihiy\OldNewExplorer" /f | |||
reg add "HKU\%~1\SOFTWARE\Tihiy\OldNewExplorer" /v "Details" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%~1\SOFTWARE\Tihiy\OldNewExplorer" /v "DriveGrouping" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%~1\SOFTWARE\Tihiy\OldNewExplorer" /v "HideFolders" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%~1\SOFTWARE\Tihiy\OldNewExplorer" /v "IEButtons" /t REG_DWORD /d 0 /f | |||
reg add "HKU\%~1\SOFTWARE\Tihiy\OldNewExplorer" /v "NavBarGlass" /t REG_DWORD /d 0 /f | |||
reg add "HKU\%~1\SOFTWARE\Tihiy\OldNewExplorer" /v "NoCaption" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%~1\SOFTWARE\Tihiy\OldNewExplorer" /v "NoIcon" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%~1\SOFTWARE\Tihiy\OldNewExplorer" /v "NoRibbon" /t REG_DWORD /d 1 /f | |||
reg add "HKU\%~1\SOFTWARE\Tihiy\OldNewExplorer" /v "NoUpButton" /t REG_DWORD /d 0 /f | |||
@echo OFF | |||
exit /b 0 |
@ -1,2 +1,33 @@ | |||
cd Executables | |||
@powershell -NoProfile -ExecutionPolicy Bypass -File tiles.ps1 | |||
@if exist "%SYSTEMDRIVE%\Windows\StartMenuLayout.xml" echo del /q /f "%SYSTEMDRIVE%\Windows\StartMenuLayout.xml" & del /q /f "%SYSTEMDRIVE%\Windows\StartMenuLayout.xml" | |||
copy /y "Layout.xml" "%SYSTEMDRIVE%\Windows\StartMenuLayout.xml" | |||
@echo OFF | |||
for /f "usebackq tokens=2 delims=\" %%A in (`reg query "HKEY_USERS" ^| findstr /c:"S-" /c:"AME_UserHive_"`) do ( | |||
REM If the "Volatile Environment" key exists, that means it is a proper user. Built in accounts/SIDs don't have this key. | |||
reg query "HKEY_USERS\%%A" | findstr /c:"Volatile Environment" /c:"AME_UserHive_" > NUL 2>&1 | |||
if not errorlevel 1 ( | |||
for /f "usebackq tokens=3* delims= " %%B in (`reg query "HKU\%%A\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Local AppData" 2^>^&1 ^| findstr /R /X /C:".*Local AppData[ ]*REG_SZ[ ].*"`) do ( | |||
echo copy /y "Layout.xml" "%%C\Microsoft\Windows\Shell\LayoutModification.xml" | |||
copy /y "Layout.xml" "%%C\Microsoft\Windows\Shell\LayoutModification.xml" | |||
) | |||
echo reg add "HKU\%%A\SOFTWARE\Policies\Microsoft\Windows\Explorer" /f | |||
reg add "HKU\%%A\SOFTWARE\Policies\Microsoft\Windows\Explorer" /f | |||
echo reg add "HKU\%%A\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "LockedStartLayout" /t REG_DWORD /d 0 /f | |||
reg add "HKU\%%A\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "LockedStartLayout" /t REG_DWORD /d 0 /f | |||
echo reg add "HKU\%%A\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "StartLayoutFile" /t REG_SZ /d "C:\Windows\StartMenuLayout.xml" /f | |||
reg add "HKU\%%A\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "StartLayoutFile" /t REG_SZ /d "C:\Windows\StartMenuLayout.xml" /f | |||
for /f "usebackq delims=" %%C in (`reg query "HKU\%%A\SOFTWARE\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount" ^| findstr /c:"start.tilegrid"`) do ( | |||
echo reg delete "%%C" /f | |||
reg delete "%%C" /f | |||
) | |||
) | |||
) | |||
@echo ON | |||
PowerShell -NoP -C "Import-StartLayout -LayoutPath '%SYSTEMDRIVE%\Windows\StartMenuLayout.xml' -MountPath $env:SystemDrive\\" | |||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /f | |||
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "StartLayoutFile" /t REG_SZ /d "%SYSTEMDRIVE%\Windows\StartMenuLayout.xml" /f |
@ -1,62 +1,111 @@ | |||
@ECHO OFF | |||
cd Executables | |||
CD Executables | |||
@echo OFF | |||
set "RunEC=10" | |||
for /f "usebackq tokens=2 delims=\" %%A in (`reg query "HKEY_USERS" ^| findstr /c:"S-" /c:"AME_UserHive_"`) do ( | |||
for /f "usebackq tokens=2* delims= " %%B in (`reg query "HKU\%%A\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "AppData" 2^>^&1 ^| findstr /R /X /C:".*AppData[ ]*REG_SZ[ ].*"`) do ( | |||
call :WALLRUN "%%A" "%%C" | |||
IF errorlevel 5 set "RunEC=5" | |||
IF errorlevel 4 set "RunEC=4" | |||
IF errorlevel 3 set "RunEC=3" | |||
IF errorlevel 2 set "RunEC=2" | |||
IF errorlevel 1 set "RunEC=1" | |||
IF errorlevel 0 set "RunEC=0" | |||
) | |||
) | |||
for /f "usebackq tokens=2 delims=\" %%A in (`reg query "HKEY_USERS" ^| findstr /c:"AME_UserHive_"`) do echo reg unload "%%A" & reg unload "%%A" | |||
exit /b %RunEC% | |||
IF NOT EXIST "%WINDIR%\Web\Wallpaper\Windows" SET "wallFail=true" & GOTO lockScreen | |||
IF EXIST "%APPDATA%\Microsoft\Windows\Themes\Transcoded_000" SET "wallFail=true" & GOTO lockScreen | |||
IF NOT EXIST "%APPDATA%\Microsoft\Windows\Themes\TranscodedWallpaper" SET "wallFail=true" & GOTO lockScreen | |||
:WALLRUN | |||
POWERSHELL -NoP -C "Add-Type -AssemblyName System.Drawing; $img = New-Object System.Drawing.Bitmap '%APPDATA%\Microsoft\Windows\Themes\TranscodedWallpaper'; if ($img.Flags -ne 77840) {EXIT 1}; if ($img.HorizontalResolution -ne 96) {EXIT 1}; if ($img.VerticalResolution -ne 96) {EXIT 1}; if ($img.PropertyIdList -notcontains 40961) {EXIT 1}; if ($img.PropertyIdList -notcontains 20624) {EXIT 1}; if ($img.PropertyIdList -notcontains 20625) {EXIT 1}" | |||
IF %ERRORLEVEL% NEQ 0 SET "wallChanged=true" & GOTO lockScreen | |||
if not exist "%WINDIR%\Web\Wallpaper\Windows" echo mkdir "%WINDIR%\Web\Wallpaper\Windows" & mkdir "%WINDIR%\Web\Wallpaper\Windows" | |||
if exist "%~2\Microsoft\Windows\Themes\Transcoded_000" set "wallChanged=true" & goto lockScreen | |||
if not exist "%~2\Microsoft\Windows\Themes\TranscodedWallpaper" set "wallFail=true" & goto lockScreen | |||
TAKEOWN /F "%WINDIR%\Web\4K\Wallpaper\Windows\*.jpg" > NUL | |||
ICACLS "%WINDIR%\Web\4K\Wallpaper\Windows\*.jpg" /reset > NUL | |||
COPY img0_*.jpg "%WINDIR%\Web\4K\Wallpaper\Windows\" /Y > NUL | |||
echo PowerShell -NoP -C "Add-Type -AssemblyName System.Drawing; $img = New-Object System.Drawing.Bitmap '%~2\Microsoft\Windows\Themes\TranscodedWallpaper'; if ($img.Flags -ne 77840) {exit 1}; if ($img.HorizontalResolution -ne 96) {exit 1}; if ($img.VerticalResolution -ne 96) {exit 1}; if ($img.PropertyIdList -notcontains 40961) {exit 1}; if ($img.PropertyIdList -notcontains 20624) {exit 1}; if ($img.PropertyIdList -notcontains 20625) {exit 1}" | |||
PowerShell -NoP -C "Add-Type -AssemblyName System.Drawing; $img = New-Object System.Drawing.Bitmap '%~2\Microsoft\Windows\Themes\TranscodedWallpaper'; if ($img.Flags -ne 77840) {exit 1}; if ($img.HorizontalResolution -ne 96) {exit 1}; if ($img.VerticalResolution -ne 96) {exit 1}; if ($img.PropertyIdList -notcontains 40961) {exit 1}; if ($img.PropertyIdList -notcontains 20624) {exit 1}; if ($img.PropertyIdList -notcontains 20625) {exit 1}" | |||
if %errorlevel% NEQ 0 set "wallChanged=true" & goto lockScreen | |||
TAKEOWN /F "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" > NUL 2>&1 | |||
ICACLS "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" /reset > NUL | |||
COPY "img0.jpg" "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" /Y > NUL 2>&1 | |||
if exist "img0_*" ( | |||
echo takeown /f "%WINDIR%\Web\4K\Wallpaper\Windows\*.jpg" | |||
takeown /f "%WINDIR%\Web\4K\Wallpaper\Windows\*.jpg" | |||
echo icacls "%WINDIR%\Web\4K\Wallpaper\Windows\*.jpg" /reset | |||
icacls "%WINDIR%\Web\4K\Wallpaper\Windows\*.jpg" /reset | |||
echo move /y img0_*.jpg "%WINDIR%\Web\4K\Wallpaper\Windows" | |||
move /y img0_*.jpg "%WINDIR%\Web\4K\Wallpaper\Windows" | |||
) | |||
COPY "ame_wallpaper_1440.bmp" "%WINDIR%\Web\Wallpaper\Windows\" /Y > NUL 2>&1 | |||
IF NOT EXIST "%WINDIR%\Web\Wallpaper\Windows\ame_wallpaper_1440.bmp" SET "wallFail=true" & GOTO lockScreen | |||
if exist "img0.jpg" ( | |||
echo takeown /f "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" | |||
takeown /f "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" | |||
echo icacls "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" /reset | |||
icacls "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" /reset | |||
echo move /y "img0.jpg" "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" | |||
move /y "img0.jpg" "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" | |||
) | |||
REG ADD "HKCU\Control Panel\Desktop" /v WallPaper /t REG_SZ /d "%WINDIR%\Web\Wallpaper\Windows\ame_wallpaper_1440.bmp" /f > NUL | |||
IF %ERRORLEVEL% NEQ 0 SET "wallFail=true" & GOTO lockScreen | |||
if exist "ame_wallpaper_1440.bmp" ( | |||
echo move /y "ame_wallpaper_1440.bmp" "%WINDIR%\Web\Wallpaper\Windows" | |||
move /y "ame_wallpaper_1440.bmp" "%WINDIR%\Web\Wallpaper\Windows" | |||
echo icacls "%WINDIR%\Web\Wallpaper\Windows\ame_wallpaper_1440.bmp" /reset | |||
icacls "%WINDIR%\Web\Wallpaper\Windows\ame_wallpaper_1440.bmp" /reset | |||
) | |||
if not exist "%WINDIR%\Web\Wallpaper\Windows\ame_wallpaper_1440.bmp" set "wallFail=true" & goto lockScreen | |||
:lockScreen | |||
echo reg add "HKEY_USERS\%~1\Control Panel\Desktop" /v WallPaper /t REG_SZ /d "%WINDIR%\Web\Wallpaper\Windows\ame_wallpaper_1440.bmp" /f | |||
reg add "HKEY_USERS\%~1\Control Panel\Desktop" /v WallPaper /t REG_SZ /d "%WINDIR%\Web\Wallpaper\Windows\ame_wallpaper_1440.bmp" /f | |||
if %errorlevel% NEQ 0 set "wallFail=true" & goto lockScreen | |||
FOR /F "tokens=2* delims=\" %%B IN ('WMIC computersystem get username') DO SET "currentUsername=%%B" | |||
SET "currentUsername=%currentUsername:~0,-3%" | |||
REM Detection for if user changed their username without restarting | |||
ECHO "%currentUsername%" | FINDSTR /I /X /c:""""~0,-3""" ">NUL 2>&1 && SET "currentUsername=%username%" | |||
:lockScreen | |||
FOR /F "usebackq tokens=1 delims= " %%A IN (`WMIC useraccount where "name="%currentUsername%"" get sid 2^>^&1 ^| FINDSTR "S-"`) DO SET "userSID=%%A" | |||
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Creative\%~1" /v "RotatingLockScreen*" > NUL 2>&1 | |||
if %errorlevel% NEQ 0 ( | |||
echo reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Creative\%~1" /v "RotatingLockScreenEnabled" /t REG_DWORD /d 0 /f | |||
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Creative\%~1" /v "RotatingLockScreenEnabled" /t REG_DWORD /d 0 /f | |||
echo reg add "HKU\%~1\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "RotatingLockScreenEnabled" /t REG_DWORD /d 0 /f | |||
reg add "HKU\%~1\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "RotatingLockScreenEnabled" /t REG_DWORD /d 0 /f | |||
REG QUERY "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Creative\%userSID%" /v "RotatingLockScreen*" > NUL 2>&1 | |||
IF %ERRORLEVEL% NEQ 0 ( | |||
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Creative\%userSID%" /v "RotatingLockScreenEnabled" /t REG_DWORD /d 0 /f > NUL | |||
REG ADD "HKU\%userSID%\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "RotatingLockScreenEnabled" /t REG_DWORD /d 0 /f > NUL | |||
if exist "img100.jpg" ( | |||
echo takeown /f "%WINDIR%\Web\Screen\img100.jpg" | |||
takeown /f "%WINDIR%\Web\Screen\img100.jpg" | |||
echo icacls "%WINDIR%\Web\Screen\img100.jpg" /reset | |||
icacls "%WINDIR%\Web\Screen\img100.jpg" /reset | |||
echo copy "img100.jpg" "%WINDIR%\Web\Screen\img100.jpg" /Y | |||
copy "img100.jpg" "%WINDIR%\Web\Screen\img100.jpg" /Y | |||
) | |||
TAKEOWN /F "%WINDIR%\Web\Screen\img100.jpg">NUL 2>&1 & TAKEOWN /F "%WINDIR%\Web\Screen\img103.png">NUL 2>&1 & TAKEOWN /F "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" > NUL 2>&1 | |||
ICACLS "%WINDIR%\Web\Screen\img100.jpg" /reset>NUL & ICACLS "%WINDIR%\Web\Screen\img103.png" /reset>NUL & ICACLS "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" /reset > NUL | |||
if exist "img103.png" ( | |||
echo takeown /f "%WINDIR%\Web\Screen\img103.png" | |||
takeown /f "%WINDIR%\Web\Screen\img103.png" | |||
echo icacls "%WINDIR%\Web\Screen\img103.png" /reset | |||
icacls "%WINDIR%\Web\Screen\img103.png" /reset | |||
echo copy "img103.png" "%WINDIR%\Web\Screen\img103.png" /Y | |||
copy "img103.png" "%WINDIR%\Web\Screen\img103.png" /Y | |||
) | |||
COPY "img100.jpg" "%WINDIR%\Web\Screen\img100.jpg" /Y > NUL | |||
COPY "img103.png" "%WINDIR%\Web\Screen\img103.png" /Y > NUL | |||
COPY "img0.jpg" "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" /Y > NUL 2>&1 | |||
if exist "img0.jpg" ( | |||
echo takeown /f "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" | |||
takeown /f "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" | |||
echo icacls "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" /reset | |||
icacls "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" /reset | |||
echo copy "img0.jpg" "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" /Y | |||
copy "img0.jpg" "%WINDIR%\Web\Wallpaper\Windows\img0.jpg" /Y | |||
) | |||
REM Clear cache | |||
TAKEOWN /R /D Y /F "%PROGRAMDATA%\Microsoft\Windows\SystemData" > NUL | |||
ICACLS "%PROGRAMDATA%\Microsoft\Windows\SystemData" /reset /t > NUL | |||
FOR /D %%A IN ("%PROGRAMDATA%\Microsoft\Windows\SystemData\*") DO ( | |||
FOR /D %%B IN ("%%A\ReadOnly\LockScreen_*") DO RMDIR /S /Q "%%B" | |||
echo takeown /R /D Y /F "%PROGRAMDATA%\Microsoft\Windows\SystemData" | |||
takeown /R /D Y /F "%PROGRAMDATA%\Microsoft\Windows\SystemData" | |||
echo icacls "%PROGRAMDATA%\Microsoft\Windows\SystemData" /reset /t | |||
icacls "%PROGRAMDATA%\Microsoft\Windows\SystemData" /reset /t | |||
for /d %%A in ("%PROGRAMDATA%\Microsoft\Windows\SystemData\*") do ( | |||
for /d %%B in ("%%A\ReadOnly\LockScreen_*") do echo rmdir /q /s "%%B" & rmdir /q /s "%%B" | |||
) | |||
IF "%wallChanged%"=="true" EXIT /B 1 | |||
IF "%wallFail%"=="true" EXIT /B 4 | |||
) ELSE ( | |||
IF "%wallChanged%"=="true" EXIT /B 3 | |||
IF "%wallFail%"=="true" EXIT /B 5 | |||
EXIT /B 2 | |||
if "%wallChanged%"=="true" exit /b 1 | |||
if "%wallFail%"=="true" exit /b 4 | |||
) else ( | |||
if "%wallChanged%"=="true" exit /b 3 | |||
if "%wallFail%"=="true" exit /b 5 | |||
exit /b 2 | |||
) | |||
EXIT /B 0 | |||
exit /b 0 |
@ -1,2 +1,3 @@ | |||
cd Executables | |||
@powershell -NoProfile -ExecutionPolicy Bypass -File scoop.ps1 | |||
@PowerShell -NoP -ExecutionPolicy Bypass -File scoop.ps1 |
@ -0,0 +1,255 @@ | |||
function Get-Hash { | |||
[CmdletBinding()] | |||
param ( | |||
[Parameter( Position = 0, Mandatory = $True )] | |||
[string] | |||
$BaseInfo | |||
) | |||
function local:Get-ShiftRight { | |||
[CmdletBinding()] | |||
param ( | |||
[Parameter( Position = 0, Mandatory = $true)] | |||
[long] $iValue, | |||
[Parameter( Position = 1, Mandatory = $true)] | |||
[int] $iCount | |||
) | |||
if ($iValue -band 0x80000000) { | |||
Write-Output (( $iValue -shr $iCount) -bxor 0xFFFF0000) | |||
} | |||
else { | |||
Write-Output ($iValue -shr $iCount) | |||
} | |||
} | |||
function local:Get-Long { | |||
[CmdletBinding()] | |||
param ( | |||
[Parameter( Position = 0, Mandatory = $true)] | |||
[byte[]] $Bytes, | |||
[Parameter( Position = 1)] | |||
[int] $Index = 0 | |||
) | |||
Write-Output ([BitConverter]::ToInt32($Bytes, $Index)) | |||
} | |||
function local:Convert-Int32 { | |||
param ( | |||
[Parameter( Position = 0, Mandatory = $true)] | |||
$Value | |||
) | |||
[byte[]] $bytes = [BitConverter]::GetBytes($Value) | |||
return [BitConverter]::ToInt32( $bytes, 0) | |||
} | |||
[Byte[]] $bytesBaseInfo = [System.Text.Encoding]::Unicode.GetBytes($baseInfo) | |||
$bytesBaseInfo += 0x00, 0x00 | |||
$MD5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider | |||
[Byte[]] $bytesMD5 = $MD5.ComputeHash($bytesBaseInfo) | |||
$lengthBase = ($baseInfo.Length * 2) + 2 | |||
$length = (($lengthBase -band 4) -le 1) + (Get-ShiftRight $lengthBase 2) - 1 | |||
$base64Hash = "" | |||
if ($length -gt 1) { | |||
$map = @{PDATA = 0; CACHE = 0; COUNTER = 0 ; INDEX = 0; MD51 = 0; MD52 = 0; OUTHASH1 = 0; OUTHASH2 = 0; | |||
R0 = 0; R1 = @(0, 0); R2 = @(0, 0); R3 = 0; R4 = @(0, 0); R5 = @(0, 0); R6 = @(0, 0); R7 = @(0, 0) | |||
} | |||
$map.CACHE = 0 | |||
$map.OUTHASH1 = 0 | |||
$map.PDATA = 0 | |||
$map.MD51 = (((Get-Long $bytesMD5) -bor 1) + 0x69FB0000L) | |||
$map.MD52 = ((Get-Long $bytesMD5 4) -bor 1) + 0x13DB0000L | |||
$map.INDEX = Get-ShiftRight ($length - 2) 1 | |||
$map.COUNTER = $map.INDEX + 1 | |||
while ($map.COUNTER) { | |||
$map.R0 = Convert-Int32 ((Get-Long $bytesBaseInfo $map.PDATA) + [long]$map.OUTHASH1) | |||
$map.R1[0] = Convert-Int32 (Get-Long $bytesBaseInfo ($map.PDATA + 4)) | |||
$map.PDATA = $map.PDATA + 8 | |||
$map.R2[0] = Convert-Int32 (($map.R0 * ([long]$map.MD51)) - (0x10FA9605L * ((Get-ShiftRight $map.R0 16)))) | |||
$map.R2[1] = Convert-Int32 ((0x79F8A395L * ([long]$map.R2[0])) + (0x689B6B9FL * (Get-ShiftRight $map.R2[0] 16))) | |||
$map.R3 = Convert-Int32 ((0xEA970001L * $map.R2[1]) - (0x3C101569L * (Get-ShiftRight $map.R2[1] 16) )) | |||
$map.R4[0] = Convert-Int32 ($map.R3 + $map.R1[0]) | |||
$map.R5[0] = Convert-Int32 ($map.CACHE + $map.R3) | |||
$map.R6[0] = Convert-Int32 (($map.R4[0] * [long]$map.MD52) - (0x3CE8EC25L * (Get-ShiftRight $map.R4[0] 16))) | |||
$map.R6[1] = Convert-Int32 ((0x59C3AF2DL * $map.R6[0]) - (0x2232E0F1L * (Get-ShiftRight $map.R6[0] 16))) | |||
$map.OUTHASH1 = Convert-Int32 ((0x1EC90001L * $map.R6[1]) + (0x35BD1EC9L * (Get-ShiftRight $map.R6[1] 16))) | |||
$map.OUTHASH2 = Convert-Int32 ([long]$map.R5[0] + [long]$map.OUTHASH1) | |||
$map.CACHE = ([long]$map.OUTHASH2) | |||
$map.COUNTER = $map.COUNTER - 1 | |||
} | |||
[Byte[]] $outHash = @(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) | |||
[byte[]] $buffer = [BitConverter]::GetBytes($map.OUTHASH1) | |||
$buffer.CopyTo($outHash, 0) | |||
$buffer = [BitConverter]::GetBytes($map.OUTHASH2) | |||
$buffer.CopyTo($outHash, 4) | |||
$map = @{PDATA = 0; CACHE = 0; COUNTER = 0 ; INDEX = 0; MD51 = 0; MD52 = 0; OUTHASH1 = 0; OUTHASH2 = 0; | |||
R0 = 0; R1 = @(0, 0); R2 = @(0, 0); R3 = 0; R4 = @(0, 0); R5 = @(0, 0); R6 = @(0, 0); R7 = @(0, 0) | |||
} | |||
$map.CACHE = 0 | |||
$map.OUTHASH1 = 0 | |||
$map.PDATA = 0 | |||
$map.MD51 = ((Get-Long $bytesMD5) -bor 1) | |||
$map.MD52 = ((Get-Long $bytesMD5 4) -bor 1) | |||
$map.INDEX = Get-ShiftRight ($length - 2) 1 | |||
$map.COUNTER = $map.INDEX + 1 | |||
while ($map.COUNTER) { | |||
$map.R0 = Convert-Int32 ((Get-Long $bytesBaseInfo $map.PDATA) + ([long]$map.OUTHASH1)) | |||
$map.PDATA = $map.PDATA + 8 | |||
$map.R1[0] = Convert-Int32 ($map.R0 * [long]$map.MD51) | |||
$map.R1[1] = Convert-Int32 ((0xB1110000L * $map.R1[0]) - (0x30674EEFL * (Get-ShiftRight $map.R1[0] 16))) | |||
$map.R2[0] = Convert-Int32 ((0x5B9F0000L * $map.R1[1]) - (0x78F7A461L * (Get-ShiftRight $map.R1[1] 16))) | |||
$map.R2[1] = Convert-Int32 ((0x12CEB96DL * (Get-ShiftRight $map.R2[0] 16)) - (0x46930000L * $map.R2[0])) | |||
$map.R3 = Convert-Int32 ((0x1D830000L * $map.R2[1]) + (0x257E1D83L * (Get-ShiftRight $map.R2[1] 16))) | |||
$map.R4[0] = Convert-Int32 ([long]$map.MD52 * ([long]$map.R3 + (Get-Long $bytesBaseInfo ($map.PDATA - 4)))) | |||
$map.R4[1] = Convert-Int32 ((0x16F50000L * $map.R4[0]) - (0x5D8BE90BL * (Get-ShiftRight $map.R4[0] 16))) | |||
$map.R5[0] = Convert-Int32 ((0x96FF0000L * $map.R4[1]) - (0x2C7C6901L * (Get-ShiftRight $map.R4[1] 16))) | |||
$map.R5[1] = Convert-Int32 ((0x2B890000L * $map.R5[0]) + (0x7C932B89L * (Get-ShiftRight $map.R5[0] 16))) | |||
$map.OUTHASH1 = Convert-Int32 ((0x9F690000L * $map.R5[1]) - (0x405B6097L * (Get-ShiftRight ($map.R5[1]) 16))) | |||
$map.OUTHASH2 = Convert-Int32 ([long]$map.OUTHASH1 + $map.CACHE + $map.R3) | |||
$map.CACHE = ([long]$map.OUTHASH2) | |||
$map.COUNTER = $map.COUNTER - 1 | |||
} | |||
$buffer = [BitConverter]::GetBytes($map.OUTHASH1) | |||
$buffer.CopyTo($outHash, 8) | |||
$buffer = [BitConverter]::GetBytes($map.OUTHASH2) | |||
$buffer.CopyTo($outHash, 12) | |||
[Byte[]] $outHashBase = @(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) | |||
$hashValue1 = ((Get-Long $outHash 8) -bxor (Get-Long $outHash)) | |||
$hashValue2 = ((Get-Long $outHash 12) -bxor (Get-Long $outHash 4)) | |||
$buffer = [BitConverter]::GetBytes($hashValue1) | |||
$buffer.CopyTo($outHashBase, 0) | |||
$buffer = [BitConverter]::GetBytes($hashValue2) | |||
$buffer.CopyTo($outHashBase, 4) | |||
$base64Hash = [Convert]::ToBase64String($outHashBase) | |||
} | |||
Write-Output $base64Hash | |||
} | |||
function Get-Time { | |||
$now = [DateTime]::Now | |||
$dateTime = [DateTime]::New($now.Year, $now.Month, $now.Day, $now.Hour, $now.Minute, 0) | |||
$fileTime = $dateTime.ToFileTime() | |||
$hi = ($fileTime -shr 32) | |||
$low = ($fileTime -band 0xFFFFFFFFL) | |||
$dateTimeHex = ($hi.ToString("X8") + $low.ToString("X8")).ToLower() | |||
Write-Output $dateTimeHex | |||
} | |||
function Delete-UserChoiceKey { | |||
param ( | |||
[Parameter( Position = 0, Mandatory = $True )] | |||
[String] | |||
$Key | |||
) | |||
$code = @' | |||
using System; | |||
using System.Runtime.InteropServices; | |||
using Microsoft.Win32; | |||
namespace Registry { | |||
public class Utils { | |||
[DllImport("advapi32.dll", SetLastError = true)] | |||
private static extern int RegOpenKeyEx(UIntPtr hKey, string subKey, int ulOptions, int samDesired, out UIntPtr hkResult); | |||
[DllImport("advapi32.dll", SetLastError=true, CharSet = CharSet.Unicode)] | |||
private static extern uint RegDeleteKey(UIntPtr hKey, string subKey); | |||
public static void DeleteKey(string key) { | |||
UIntPtr hKey = UIntPtr.Zero; | |||
RegOpenKeyEx((UIntPtr)0x80000003u, key, 0, 0x20019, out hKey); | |||
RegDeleteKey((UIntPtr)0x80000003u, key); | |||
} | |||
} | |||
} | |||
'@ | |||
Add-Type -TypeDefinition $code | |||
[Registry.Utils]::DeleteKey($Key) | |||
} | |||
$userExperienceSearch = "User Choice set via Windows User Experience" | |||
$user32Path = [Environment]::GetFolderPath([Environment+SpecialFolder]::SystemX86) + "\Shell32.dll" | |||
$fileStream = [System.IO.File]::Open($user32Path, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::ReadWrite) | |||
$binaryReader = New-Object System.IO.BinaryReader($fileStream) | |||
[Byte[]] $bytesData = $binaryReader.ReadBytes(5mb) | |||
$fileStream.Close() | |||
$dataString = [Text.Encoding]::Unicode.GetString($bytesData) | |||
$position1 = $dataString.IndexOf($userExperienceSearch) | |||
$position2 = $dataString.IndexOf("}", $position1) | |||
$userExperience = $dataString.Substring($position1, $position2 - $position1 + 1) | |||
$SID = $args[0] | |||
$Hive = $args[1] | |||
Write-Host "Setting file associations for HKEY_USERS\$Hive..." | |||
New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS | Out-Null | |||
If (-NOT (Test-Path "HKU:\$Hive\SOFTWARE\Clients")) { | |||
New-Item -Path "HKU:\$Hive\SOFTWARE\Clients" -Force | Out-Null | |||
} | |||
If (-NOT (Test-Path "HKU:\$Hive\SOFTWARE\Clients\StartMenuInternet")) { | |||
New-Item -Path "HKU:\$Hive\SOFTWARE\Clients\StartMenuInternet" -Force | Out-Null | |||
} | |||
Get-Item -Path "HKLM:\SOFTWARE\Clients\StartMenuInternet\*" | | |||
ForEach-Object { | |||
Copy-Item -Path "$($_.PSPath)" -Destination "HKU:\$Hive\SOFTWARE\Clients\StartMenuInternet" -Force -Recurse | Out-Null | |||
} | |||
for ($i = 2; $i -lt $args.Length; $i++) { | |||
$splitArg = $args[$i] -split ":" | |||
if ($splitArg[0] -eq "Proto") { | |||
If (-NOT (Test-Path "HKU:\$Hive\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\$($splitArg[1])")) { | |||
New-Item -Path "HKU:\$Hive\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\$($splitArg[1])" -Force | Out-Null | |||
} | |||
If (Test-Path "HKU:\$Hive\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\$($splitArg[1])\UserChoice") { | |||
Delete-UserChoiceKey "$Hive\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\$($splitArg[1])\UserChoice" | Out-Null | |||
} | |||
New-ItemProperty -Path "HKU:\$Hive\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" -Name "$($splitArg[2])_$($splitArg[1])" -PropertyType DWORD -Value 0 -Force | Out-Null | |||
$dateTimeHex = Get-Time | |||
$hash = Get-Hash "$($splitArg[1])$SID$($splitArg[2])$dateTimeHex$userExperience".ToLower() | |||
[Microsoft.Win32.Registry]::SetValue("HKEY_USERS\$Hive\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\$($splitArg[1])\UserChoice", "Hash", $hash) | |||
[Microsoft.Win32.Registry]::SetValue("HKEY_USERS\$Hive\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\$($splitArg[1])\UserChoice", "ProgId", "$($splitArg[2])") | |||
} else { | |||
If (-NOT (Test-Path "HKU:\$Hive\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$($splitArg[0])")) { | |||
New-Item -Path "HKU:\$Hive\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$($splitArg[0])" -Force | Out-Null | |||
} | |||
If (Test-Path "HKU:\$Hive\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$($splitArg[0])\UserChoice") { | |||
Delete-UserChoiceKey "$Hive\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$($splitArg[0])\UserChoice" | |||
} | |||
New-ItemProperty -Path "HKU:\$Hive\SOFTWARE\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" -Name "$($splitArg[1])_$($splitArg[0])" -PropertyType DWORD -Value 0 -Force | Out-Null | |||
$dateTimeHex = Get-Time | |||
$hash = Get-Hash "$($splitArg[0])$SID$($splitArg[1])$dateTimeHex$userExperience".ToLower() | |||
[Microsoft.Win32.Registry]::SetValue("HKEY_USERS\$Hive\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$($splitArg[0])\UserChoice", "Hash", $hash) | |||
[Microsoft.Win32.Registry]::SetValue("HKEY_USERS\$Hive\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$($splitArg[0])\UserChoice", "ProgId", "$($splitArg[1])") | |||
} | |||
} |
@ -1,77 +0,0 @@ | |||
Add-Type -AssemblyName System.Windows.Forms | |||
$screen = [System.Windows.Forms.SystemInformation]::VirtualScreen | |||
$screen | Get-Member -MemberType Property | |||
$cSource = @' | |||
using System; | |||
using System.Drawing; | |||
using System.Runtime.InteropServices; | |||
using System.Windows.Forms; | |||
public class Clicker | |||
{ | |||
//https://msdn.microsoft.com/en-us/library/windows/desktop/ms646270(v=vs.85).aspx | |||
[StructLayout(LayoutKind.Sequential)] | |||
struct INPUT | |||
{ | |||
public int type; // 0 = INPUT_MOUSE, | |||
// 1 = INPUT_KEYBOARD | |||
// 2 = INPUT_HARDWARE | |||
public MOUSEINPUT mi; | |||
} | |||
//https://msdn.microsoft.com/en-us/library/windows/desktop/ms646273(v=vs.85).aspx | |||
[StructLayout(LayoutKind.Sequential)] | |||
struct MOUSEINPUT | |||
{ | |||
public int dx ; | |||
public int dy ; | |||
public int mouseData ; | |||
public int dwFlags; | |||
public int time; | |||
public IntPtr dwExtraInfo; | |||
} | |||
//This covers most use cases although complex mice may have additional buttons | |||
//There are additional constants you can use for those cases, see the msdn page | |||
const int MOUSEEVENTF_MOVED = 0x0001 ; | |||
const int MOUSEEVENTF_LEFTDOWN = 0x0002 ; | |||
const int MOUSEEVENTF_LEFTUP = 0x0004 ; | |||
const int MOUSEEVENTF_RIGHTDOWN = 0x0008 ; | |||
const int MOUSEEVENTF_RIGHTUP = 0x0010 ; | |||
const int MOUSEEVENTF_MIDDLEDOWN = 0x0020 ; | |||
const int MOUSEEVENTF_MIDDLEUP = 0x0040 ; | |||
const int MOUSEEVENTF_WHEEL = 0x0080 ; | |||
const int MOUSEEVENTF_XDOWN = 0x0100 ; | |||
const int MOUSEEVENTF_XUP = 0x0200 ; | |||
const int MOUSEEVENTF_ABSOLUTE = 0x8000 ; | |||
const int screen_length = 0x10000 ; | |||
//https://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx | |||
[System.Runtime.InteropServices.DllImport("user32.dll")] | |||
extern static uint SendInput(uint nInputs, INPUT[] pInputs, int cbSize); | |||
public static void LeftClickAtPoint(int x, int y) | |||
{ | |||
//Move the mouse | |||
INPUT[] input = new INPUT[3]; | |||
input[0].mi.dx = x*(65535/System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width); | |||
input[0].mi.dy = y*(65535/System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height); | |||
input[0].mi.dwFlags = MOUSEEVENTF_MOVED | MOUSEEVENTF_ABSOLUTE; | |||
//Left mouse button down | |||
input[1].mi.dwFlags = MOUSEEVENTF_LEFTDOWN; | |||
//Left mouse button up | |||
input[2].mi.dwFlags = MOUSEEVENTF_LEFTUP; | |||
SendInput(3, input, Marshal.SizeOf(input[0])); | |||
} | |||
} | |||
'@ | |||
Add-Type -TypeDefinition $cSource -ReferencedAssemblies System.Windows.Forms,System.Drawing | |||
#Send a click at a specified point | |||
[Clicker]::LeftClickAtPoint(0,$($screen.Height)) | |||
Start-Sleep -Seconds 5 | |||
$wshell = New-Object -ComObject wscript.shell; $wshell.AppActivate('Settings for Open-Shell') | |||
$wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('~') |
@ -1,7 +1,7 @@ | |||
Set-ExecutionPolicy RemoteSigned -Force -scope CurrentUser | |||
iwr -useb get.scoop.sh -outfile 'install.ps1' | |||
.\install.ps1 -RunAsAdmin | |||
.\install.ps1 -RunAsAdmin -ScoopDir "$env:ProgramFiles\Scoop" -ScoopGlobalDir "$env:ProgramFiles\Scoop\GlobalScoopApps" | |||
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | |||
scoop install git | |||
scoop install git --global | |||
scoop bucket add extras | |||
scoop install windows-terminal | |||
scoop install windows-terminal --global |
@ -1,175 +1,175 @@ | |||
@ECHO OFF | |||
SETLOCAL | |||
@echo OFF | |||
setlocal | |||
REM This script is to prevent users from unknowingly entering sfc /scannow | |||
REM and causing de-amelioration | |||
NET session > NUL 2>&1 | |||
IF %ERRORLEVEL% GTR 0 ( | |||
ECHO. | |||
ECHO You must be an administrator running a console session in order to | |||
ECHO use the sfc utility. | |||
net session > NUL 2>&1 | |||
if %errorlevel% GTR 0 ( | |||
echo. | |||
echo You must be an administrator running a console session in order to | |||
echo use the sfc utility. | |||
ENDLOCAL & EXIT /B 1 | |||
) ELSE ( | |||
GOTO checkScannow | |||
endlocal & exit /b 1 | |||
) else ( | |||
goto checkScannow | |||
) | |||
:checkScannow | |||
SET "sfcArgs=%*" | |||
SET "sfcArgs=%sfcArgs:"=:AINV:%" | |||
SET "sfcArgs=%sfcArgs:"=:AINV:%" | |||
set "sfcArgs=%*" | |||
set "sfcArgs=%sfcArgs:"=:AINV:%" | |||
set "sfcArgs=%sfcArgs:"=:AINV:%" | |||
ECHO "%sfcArgs%" | FINDSTR /i /c:"/scannow" > NUL 2>&1 | |||
IF %ERRORLEVEL% EQU 0 ( | |||
GOTO scannowProcedure | |||
) ELSE ( | |||
GOTO verifyOnlyProcedure | |||
echo "%sfcArgs%" | findstr /i /c:"/scannow" > NUL 2>&1 | |||
if %errorlevel% EQU 0 ( | |||
goto scannowProcedure | |||
) else ( | |||
goto verifyOnlyProcedure | |||
) | |||
:verifyOnlyProcedure | |||
IF /i "%sfcArgs%"=="/verifyonly" ( | |||
ECHO. | |||
ECHO Beginning system scan. This process will take some time. | |||
TIMEOUT /T 1 /NOBREAK > NUL 2>&1 | |||
ECHO. | |||
ECHO Beginning verification phase of system scan. | |||
TIMEOUT /T 2 /NOBREAK > NUL 2>&1 | |||
ECHO Verifying... | |||
if /i "%sfcArgs%"=="/verifyonly" ( | |||
echo. | |||
echo Beginning system scan. This process will take some time. | |||
timeout /t 1 /NOBREAK > NUL 2>&1 | |||
echo. | |||
echo Beginning verification phase of system scan. | |||
timeout /t 2 /NOBREAK > NUL 2>&1 | |||
echo Verifying... | |||
REM %* is all the text entered after "sfc ". | |||
sfc1 %* > NUL 2>&1 | |||
ECHO. | |||
ECHO Windows Resource Protection found integrity violations. | |||
ECHO For online repairs, details are included in the CBS log file located at | |||
ECHO windir^\Logs^\CBS^\CBS.log. For example C^:^\Windows^\Logs^\CBS^\CBS.log. For offline | |||
ECHO repairs, details are included in the log file provided by the ^/OFFLOGFILE flag. | |||
echo. | |||
echo Windows Resource Protection found integrity violations. | |||
echo For online repairs, details are included in the CBS log file located at | |||
echo windir^\Logs^\CBS^\CBS.log. For example C^:^\Windows^\Logs^\CBS^\CBS.log. For offline | |||
echo repairs, details are included in the log file provided by the ^/OFFLOGFILE flag. | |||
ENDLOCAL & EXIT /B 0 | |||
) ELSE ( | |||
GOTO incorrectSyntaxMessage ) | |||
endlocal & exit /b 0 | |||
) else ( | |||
goto incorrectSyntaxMessage ) | |||
:incorrectSyntaxMessage | |||
sfc1 %sfcArgs% > NUL 2>&1 | |||
IF %ERRORLEVEL% GTR 0 ( | |||
ECHO. | |||
ECHO System File Checker | |||
ECHO. | |||
ECHO Scans the integrity of all protected system files and replaces incorrect versions with | |||
ECHO correct Microsoft versions. | |||
ECHO. | |||
ECHO SFC ^[^/SCANNOW^] ^[^/VERIFYONLY^] ^[^/SCANFILE^=^<file^>^] ^[^/VERIFYFILE^=^<file^>] | |||
ECHO ^[^/OFFWINDIR^=^<offline windows directory^> ^/OFFBOOTDIR^=^<offline boot directory^> ^[^/OFFLOGFILE^=^<log file path^>^]^] | |||
ECHO. | |||
ECHO ^/SCANNOW Scans integrity of all protected system files and repairs files with | |||
ECHO problems when possible. | |||
ECHO ^/VERIFYONLY Scans integrity of all protected system files. No repair operation is | |||
ECHO performed. | |||
ECHO ^/SCANFILE Scans integrity of the referenced file, repairs file if problems are | |||
ECHO identified. Specify full path ^<file^> | |||
ECHO ^/VERIFYFILE Verifies the integrity of the file with full path ^<file^>. No repair | |||
ECHO operation is performed. | |||
ECHO ^/OFFBOOTDIR For offline repair, specify the location of the offline boot directory | |||
ECHO ^/OFFWINDIR For offline repair, specify the location of the offline windows directory | |||
ECHO ^/OFFLOGFILE For offline repair, optionally enable logging by specifying a log file path | |||
ECHO. | |||
ECHO e.g. | |||
ECHO. | |||
ECHO sfc ^/SCANNOW | |||
ECHO sfc ^/VERIFYFILE^=c^:^\windows^\system32^\kernel32.dll | |||
ECHO sfc ^/SCANFILE^=d^:^\windows^\system32^\kernel32.dll ^/OFFBOOTDIR^=d^:^\ ^/OFFWINDIR^=d^:^\windows | |||
ECHO sfc ^/SCANFILE^=d^:^\windows^\system32^\kernel32.dll ^/OFFBOOTDIR^=d^:^\ ^/OFFWINDIR^=d^:^\windows ^/OFFLOGFILE^=c^:^\log.txt | |||
ECHO sfc ^/VERIFYONLY | |||
ENDLOCAL & EXIT /B 2 | |||
) ELSE ( | |||
GOTO grabCBSInfo | |||
if %errorlevel% GTR 0 ( | |||
echo. | |||
echo System File Checker | |||
echo. | |||
echo Scans the integrity of all protected system files and replaces incorrect versions with | |||
echo correct Microsoft versions. | |||
echo. | |||
echo SFC ^[^/SCANNOW^] ^[^/VERIFYONLY^] ^[^/SCANFILE^=^<file^>^] ^[^/VERIFYFILE^=^<file^>] | |||
echo ^[^/OFFWINDIR^=^<offline windows directory^> ^/OFFBOOTDIR^=^<offline boot directory^> ^[^/OFFLOGFILE^=^<log file path^>^]^] | |||
echo. | |||
echo ^/SCANNOW Scans integrity of all protected system files and repairs files with | |||
echo problems when possible. | |||
echo ^/VERIFYONLY Scans integrity of all protected system files. No repair operation is | |||
echo performed. | |||
echo ^/SCANFILE Scans integrity of the referenced file, repairs file if problems are | |||
echo identified. Specify full path ^<file^> | |||
echo ^/VERIFYFILE Verifies the integrity of the file with full path ^<file^>. No repair | |||
echo operation is performed. | |||
echo ^/OFFBOOTDIR For offline repair, specify the location of the offline boot directory | |||
echo ^/OFFWINDIR For offline repair, specify the location of the offline windows directory | |||
echo ^/OFFLOGFILE For offline repair, optionally enable logging by specifying a log file path | |||
echo. | |||
echo e.g. | |||
echo. | |||
echo sfc ^/SCANNOW | |||
echo sfc ^/VERIFYFILE^=c^:^\windows^\system32^\kernel32.dll | |||
echo sfc ^/SCANFILE^=d^:^\windows^\system32^\kernel32.dll ^/OFFBOOTDIR^=d^:^\ ^/OFFWINDIR^=d^:^\windows | |||
echo sfc ^/SCANFILE^=d^:^\windows^\system32^\kernel32.dll ^/OFFBOOTDIR^=d^:^\ ^/OFFWINDIR^=d^:^\windows ^/OFFLOGFILE^=c^:^\log.txt | |||
echo sfc ^/VERIFYONLY | |||
endlocal & exit /b 2 | |||
) else ( | |||
goto grabCBSInfo | |||
) | |||
:grabCBSInfo | |||
SETLOCAL EnableDelayedExpansion | |||
SET "count=1" | |||
FOR /F "tokens=2 delims=]" %%A IN ('powershell -command "Get-Content '%SYSTEMROOT%\Logs\CBS\CBS.log' -tail 3"') DO ( | |||
SET "var!count!=%%A" | |||
SET /A "count=!count!+1" | |||
setlocal EnableDelayedExpansion | |||
set "count=1" | |||
for /f "tokens=2 delims=]" %%A in ('PowerShell -command "Get-Content '%SYSTEMROOT%\Logs\CBS\CBS.log' -tail 3"') do ( | |||
set "var!count!=%%A" | |||
set /a "count=!count!+1" | |||
) | |||
GOTO noViolationProcedure | |||
goto noViolationProcedure | |||
:noViolationProcedure | |||
SET "var2=%var2:"=:AINV:%" | |||
SET "var2=%var2:"=:AINV:%" | |||
ECHO "%var2%" | FINDSTR /i /c:"Beginning" > NUL 2>&1 | |||
IF %ERRORLEVEL% EQU 0 ( | |||
ECHO. | |||
ECHO Windows Resource Protection did not find any integrity violations. | |||
set "var2=%var2:"=:AINV:%" | |||
set "var2=%var2:"=:AINV:%" | |||
echo "%var2%" | findstr /i /c:"Beginning" > NUL 2>&1 | |||
if %errorlevel% EQU 0 ( | |||
echo. | |||
echo Windows Resource Protection did not find any integrity violations. | |||
ENDLOCAL & ENDLOCAL & EXIT /B 0 | |||
) ELSE ( | |||
GOTO foundViolationProcedure | |||
endlocal & endlocal & exit /b 0 | |||
) else ( | |||
goto foundViolationProcedure | |||
) | |||
:foundViolationProcedure | |||
SET "var1=%var1:"=:AINV:%" | |||
SET "var1=%var1:"=:AINV:%" | |||
ECHO "%var1%" | FINDSTR /i /c:"reproject" > NUL 2>&1 | |||
IF %ERRORLEVEL% EQU 0 ( | |||
ECHO. | |||
ECHO Windows Resource Protection found integrity violations. | |||
ECHO For online repairs, details are included in the CBS log file located at | |||
ECHO windir^\Logs^\CBS\CBS.log. For example C^:^\Windows^\Logs^\CBS^\CBS.log. For offline | |||
ECHO repairs, details are included in the log file provided by the ^/OFFLOGFILE flag. | |||
ENDLOCAL & ENDLOCAL & EXIT /B 3 | |||
) ELSE ( | |||
set "var1=%var1:"=:AINV:%" | |||
set "var1=%var1:"=:AINV:%" | |||
echo "%var1%" | findstr /i /c:"reproject" > NUL 2>&1 | |||
if %errorlevel% EQU 0 ( | |||
echo. | |||
echo Windows Resource Protection found integrity violations. | |||
echo For online repairs, details are included in the CBS log file located at | |||
echo windir^\Logs^\CBS\CBS.log. For example C^:^\Windows^\Logs^\CBS^\CBS.log. For offline | |||
echo repairs, details are included in the log file provided by the ^/OFFLOGFILE flag. | |||
endlocal & endlocal & exit /b 3 | |||
) else ( | |||
REM This will most likely never happen | |||
ENDLOCAL & GOTO :unknownResults | |||
endlocal & goto :unknownResults | |||
) | |||
:unknownResults | |||
ECHO. | |||
ECHO Cannot output results. Details are included in the CBS log file located at | |||
ECHO windir^\Logs^\CBS\CBS.log. | |||
echo. | |||
echo Cannot output results. Details are included in the CBS log file located at | |||
echo windir^\Logs^\CBS\CBS.log. | |||
ENDLOCAL & EXIT /B 4 | |||
endlocal & exit /b 4 | |||
:scannowProcedure | |||
ECHO. | |||
ECHO This command will cause de-amelioration! DO NOT RUN! | |||
ECHO Are you sure you want to run this command? | |||
ECHO. | |||
ECHO Enter 'Cancel' to Exit | |||
echo. | |||
echo This command will cause de-amelioration! DO NOT RUN! | |||
echo Are you sure you want to run this command? | |||
echo. | |||
echo Enter 'Cancel' to Exit | |||
SET /P "input=Enter 'I know what I'm doing' to Confirm: " | |||
IF "%input%"=="I know what I'm doing" GOTO scannowSelfDestruct | |||
IF /I "%input%"=="Cancel" ENDLOCAL & EXIT /B 0 | |||
if "%input%"=="I know what I'm doing" goto scannowSelfDestruct | |||
if /i "%input%"=="Cancel" endlocal & exit /b 0 | |||
ECHO. | |||
ECHO Incorrect input entered. | |||
echo. | |||
echo Incorrect input entered. | |||
ENDLOCAL & EXIT /B 5 | |||
endlocal & exit /b 5 | |||
:scannowSelfDestruct | |||
:: This will cause sfc.cmd to no longer function, unless sfc.cmd is specified. | |||
:: This is due to the .exe extension being prioritized over .cmd. The PATHEXT environment variable can change this. | |||
TAKEOWN /f %SYSTEMROOT%\System32\sfc1.exe /a > NUL 2>&1 | |||
ICACLS %SYSTEMROOT%\System32\sfc1.exe /grant Administrators:F > NUL 2>&1 | |||
REN %SYSTEMROOT%\System32\sfc1.exe sfc.exe > NUL 2>&1 | |||
takeown /f %SYSTEMROOT%\System32\sfc1.exe /a > NUL 2>&1 | |||
icacls %SYSTEMROOT%\System32\sfc1.exe /grant Administrators:F > NUL 2>&1 | |||
rename %SYSTEMROOT%\System32\sfc1.exe sfc.exe > NUL 2>&1 | |||
:: Copy ACL from diskmgmt.msc to sfc.exe. Essentially resetting sfc.exe's ACL. | |||
POWERSHELL -command "Get-Acl %SYSTEMROOT%\System32\diskmgmt.msc | Set-Acl %SYSTEMROOT%\System32\sfc.exe" > NUL 2>&1 | |||
PowerShell -NoP -C "Get-Acl %SYSTEMROOT%\System32\diskmgmt.msc | Set-Acl %SYSTEMROOT%\System32\sfc.exe" > NUL 2>&1 | |||
:: Self-destruction | |||
TAKEOWN /f %SYSTEMROOT%\System32\sfc.cmd /a > NUL 2>&1 | |||
ICACLS %SYSTEMROOT%\System32\sfc.cmd /grant Administrators:F > NUL 2>&1 | |||
(GOTO) 2>NUL & DEL /Q /F "%~f0">NUL 2>&1 & sfc %* | |||
takeown /f %SYSTEMROOT%\System32\sfc.cmd /a > NUL 2>&1 | |||
icacls %SYSTEMROOT%\System32\sfc.cmd /grant Administrators:F > NUL 2>&1 | |||
(GOTO) 2>NUL & del /q /f "%~f0">NUL 2>&1 & sfc %* |
@ -1,58 +0,0 @@ | |||
#Requires -RunAsAdministrator | |||
$START_MENU_LAYOUT = @" | |||
<LayoutModificationTemplate xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" Version="1" xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification"> | |||
<LayoutOptions StartTileGroupCellWidth="6" /> | |||
<DefaultLayoutOverride> | |||
<StartLayoutCollection> | |||
<defaultlayout:StartLayout GroupCellWidth="6" /> | |||
</StartLayoutCollection> | |||
</DefaultLayoutOverride> | |||
</LayoutModificationTemplate> | |||
"@ | |||
$layoutFile="C:\Windows\StartMenuLayout.xml" | |||
#Delete layout file if it already exists | |||
If(Test-Path $layoutFile) | |||
{ | |||
Remove-Item $layoutFile | |||
} | |||
#Creates the blank layout file | |||
$START_MENU_LAYOUT | Out-File $layoutFile -Encoding ASCII | |||
$regAliases = @("HKLM", "HKCU") | |||
#Assign the start layout and force it to apply with "LockedStartLayout" at both the machine and user level | |||
foreach ($regAlias in $regAliases){ | |||
$basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" | |||
$keyPath = $basePath + "\Explorer" | |||
IF(!(Test-Path -Path $keyPath)) { | |||
New-Item -Path $basePath -Name "Explorer" | |||
} | |||
Set-ItemProperty -Path $keyPath -Name "LockedStartLayout" -Value 1 | |||
Set-ItemProperty -Path $keyPath -Name "StartLayoutFile" -Value $layoutFile | |||
} | |||
#Restart Explorer, open the start menu (necessary to load the new layout), and give it a few seconds to process | |||
Stop-Process -name explorer | |||
Start-Sleep -s 5 | |||
$wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^{ESCAPE}') | |||
Start-Sleep -s 5 | |||
$wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^{ESCAPE}') | |||
#Enable the ability to pin items again by disabling "LockedStartLayout" | |||
foreach ($regAlias in $regAliases){ | |||
$basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" | |||
$keyPath = $basePath + "\Explorer" | |||
Set-ItemProperty -Path $keyPath -Name "LockedStartLayout" -Value 0 | |||
} | |||
#Restart Explorer and delete the layout file | |||
Stop-Process -name explorer | |||
# Uncomment the next line to make clean start menu default for all new users | |||
#Import-StartLayout -LayoutPath $layoutFile -MountPath $env:SystemDrive\ | |||
Remove-Item $layoutFile |