Skip to content

Commit

Permalink
fix(atlasdesktop): final fixes to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Apr 3, 2024
1 parent 8c7b9cb commit 9fb6732
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Add Theme
description: Adds and sets the Atlas themes by default
actions:
# Apply theme file
- !taskKill: {name: 'SystemSettings', ignoreErrors: true}
- !cmd:
command: 'start ms-settings:themes & ping 127.0.0.1 -n 6 > nul & start "" "Themes\atlas-v0.4.x-dark.theme"'
exeDir: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWi
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /v "AutoDownload" /t REG_DWORD /d "4" /f > nul
call "%windir%\AtlasModules\Scripts\settingsPages.cmd" /unhide mobile-devices

taskkill /f /im SystemSettings.exe > nul 2>&1
start ms-settings:mobile-devices

echo Finished, you can now use the mobile device settings to sync your phone.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
@echo off

set "___args="%~f0" %*"
fltmc > nul 2>&1 || (
echo Administrator privileges are required.
powershell -c "Start-Process -Verb RunAs -FilePath 'cmd' -ArgumentList """/c $env:___args"""" 2> nul || (
echo You must run this script as admin.
if "%*"=="" pause
exit /b 1
)
exit /b
)

:: Allow Away Mode Policy - No
powercfg /setacvalueindex scheme_current 238c9fa8-0aad-41ed-83f4-97be242c8f20 25dfa149-5dd1-4736-b5ab-e8a37b5b8187 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
@echo off

set "___args="%~f0" %*"
fltmc > nul 2>&1 || (
echo Administrator privileges are required.
powershell -c "Start-Process -Verb RunAs -FilePath 'cmd' -ArgumentList """/c $env:___args"""" 2> nul || (
echo You must run this script as admin.
if "%*"=="" pause
exit /b 1
)
exit /b
)

:: Allow Away Mode Policy - Yes
powercfg /setacvalueindex scheme_current 238c9fa8-0aad-41ed-83f4-97be242c8f20 25dfa149-5dd1-4736-b5ab-e8a37b5b8187 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ for %%a in (

if "%~1" == "/silent" exit /b

echo]
echo Finished, please reboot your device for changes to apply.
pause
exit /b
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ call setSvc.cmd PrintWorkFlowUserSvc 3

call "%windir%\AtlasModules\Scripts\settingsPages.cmd" /unhide printing

echo Enabling capabilities...
echo Enabling capabilities (this might take a while)...
for %%a in (
"Print.Fax.Scan~~~~0.0.1.0"
"Print.Management.Console~~~~0.0.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ echo Enabling News and Interests (called Widgets in Windows 11)...
) > nul 2>&1

ping 127.0.0.1 -n 2 > nul
taskkill /f /im SystemSettings.exe > nul 2>&1
start ms-settings:taskbar

echo]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Windows Registry Editor Version 5.00
@="Realtime"

[HKEY_CLASSES_ROOT\exefile\Shell\Priority\shell\001flyout\command]
@="cmd /c start \"\" /Realtime \"%1\""
@="powershell start -file 'cmd' -args '/c start \"\"\"Realtime App\"\"\" /Realtime \"\"\"%1\"\"\"' -verb runas"

[HKEY_CLASSES_ROOT\exefile\Shell\Priority\shell\002flyout]
@="High"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if not exist "%script%" (
set "___args="%~f0" %*"
fltmc > nul 2>&1 || (
echo Administrator privileges are required.
powershell -c "Start-Process -Verb RunAs -FilePath 'cmd' -ArgumentList """/c $env:___args"""" 2> nul || (
powershell -c "Start-Process -Verb RunAs -FilePath 'cmd' -ArgumentList """/c $env:___args""" -WindowStyle Minimized" 2> nul || (
echo You must run this script as admin.
if "%*"=="" pause
exit /b 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ fltmc > nul 2>&1 || (
)

:: Check if WinGet is functional or not
echo Checking if WinGet exists...
call "%windir%\AtlasModules\Scripts\wingetCheck.cmd"
if %ERRORLEVEL% NEQ 0 exit /b 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ if %ERRORLEVEL% == 1 (
)

:disable
echo]
bcdedit /set {globalsettings} custom:16000069 true > nul
goto finish

:enable
echo]
bcdedit /deletevalue {globalsettings} custom:16000069 > nul 2>&1
goto finish

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if %ERRORLEVEL% NEQ 0 (
)

echo Creating the Start menu shortcut...
PowerShell -NoP -C "$WshShell = New-Object -comObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut("""$([Environment]::GetFolderPath('CommonStartMenu'))\Programs\Process Explorer.lnk"""); $Shortcut.TargetPath = """$([Environment]::GetFolderPath('Windows'))\AtlasModules\Apps\ProcessExplorer\process-explorer.exe"""; $Shortcut.Save()" > nul
PowerShell -NoP -C "$WshShell = New-Object -comObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut("""$([Environment]::GetFolderPath('CommonStartMenu'))\Programs\Process Explorer.lnk"""); $Shortcut.TargetPath = """$([Environment]::GetFolderPath('Windows'))\AtlasModules\Apps\ProcessExplorer\procexp.exe"""; $Shortcut.Save()" > nul
if %ERRORLEVEL% NEQ 0 (
echo Process Explorer shortcut could not be created in the start menu!
)
Expand All @@ -32,7 +32,7 @@ echo Configuring Process Explorer...
:: Run Process Explorer only in one instance
reg add "HKCU\SOFTWARE\Sysinternals\Process Explorer" /v "OneInstance" /t REG_DWORD /d "1" /f > nul
sc config pcw start=disabled > nul
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe" /v "Debugger" /t REG_SZ /d "%windir%\AtlasModules\Apps\ProcessExplorer\process-explorer.exe" /f > nul
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe" /v "Debugger" /t REG_SZ /d "%windir%\AtlasModules\Apps\ProcessExplorer\procexp.exe" /f > nul

echo]
echo Finished, changes have been applied.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ ping -n 1 -4 www.example.com > nul 2>&1 || (
exit /b 1
)

set /P DNS1="Set primary DNS Server (e.g. 1.1.1.1): "
set /P DNS2="Set alternate DNS Server (e.g. 1.0.0.1): "
set /P DNS1="Set primary DNS Server (e.g. 1.1.1.1): " || set DNS1=1.1.1.1
set /P DNS2="Set alternate DNS Server (e.g. 1.0.0.1): " || set DNS1=1.0.0.1
for /f "tokens=*" %%a in ('powershell -NonI -NoP -C "(Get-NetAdapter -Physical | ? { $_.Status -eq 'Up' }).Name"') do set "DeviceName=%%a"
for /f "tokens=3" %%a in ('netsh int ip show config name^="%DeviceName%" ^| findstr "IP Address:"') do set "LocalIP=%%a"
for /f "tokens=3" %%a in ('netsh int ip show config name^="%DeviceName%" ^| findstr "Default Gateway:"') do set "DHCPGateway=%%a"
for /f "tokens=2 delims=()" %%a in ('netsh int ip show config name^="%DeviceName%" ^| findstr /r "(.*)"') do for %%i in (%%a) do set "DHCPSubnetMask=%%i"

:: Check for errors and exit if invalid
cls
echo]
if "%DeviceName%" == "" set "incorrectIP=1"
call :isValidIP %LocalIP%
call :isValidIP %DHCPGateway%
Expand All @@ -34,6 +34,7 @@ if "%incorrectIP%" == "1" (
)

:: Display details about the connection
echo ----------------------------
echo Settings to be applied
echo ----------------------------
echo Interface: %DeviceName%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ call setSvc.cmd vwififlt 4
call setSvc.cmd WlanSvc 4

echo Applications like Microsoft Store and Spotify may not function correctly when Wi-Fi is disabled.
echo If this is a problem, enable Wi-Fi and restart the computer.
echo There might be other issues as well, therefore, we do not recommend it.
pause
echo]
echo Finished, please reboot your device for changes to apply.
pause
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ setlocal EnableDelayedExpansion
if "%~1"=="/main" goto main

echo WARNING: This will force enable all security mitigiations for improved security.
echo This will slow down performance (especially on older CPUs).
echo It is recommended to use 'Set Windows Default Mitigations.cmd' instead.
echo This will slow down performance, and worsen compatibility. It is
echo recommended to use 'Set Windows Default Mitigations.cmd' instead.
echo]
ping 127.0.0.1 -n 2 > nul
echo Press any key to continue anyways...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,27 @@ echo This script will fix errors 2502 and 2503 with Windows installers by resett
echo This issue is not related to Atlas.
echo]
pause
cls
echo]

echo Taking ownership of TEMP folder as SYSTEM...
echo -------------------------------------
takeown /f "%folder%" /r /d y > nul
echo Done.

echo]
echo Clearing all current permissions...
echo -------------------------------------
icacls "%folder%" /inheritance:e > nul
icacls "%folder%" /reset > nul
icacls "%folder%" /inheritance:r > nul
echo Done.

echo]
echo Setting default permissions...
echo -------------------------------------
:: (OI)(CI) - applies recursively
:: F - full control
:: AD - create folders / append data
:: X - traverse folder / execute file
:: WD - create files / write data
icacls "%windir%\Temp" /grant:r "*S-1-5-32-545:(OI)(CI)F" /grant:r "*S-1-5-18:(OI)(CI)F" /grant:r "*S-1-3-0:(OI)(CI)F" /grant:r "*S-1-5-11:(OI)(CI)(X,AD,WD)" /t > nul
echo Done.

echo]
echo Clearing Windows temporary files...
echo -------------------------------------
:: no error checking as some files and folders will be in use
del /s /f /q "%folder%\*.*" > nul 2>&1
echo Done.

echo]
echo Completed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ if ($Enable) {

# Prompt user
$choices = (multichoice.exe "Send To Debloat" `
"Tick the default 'Send To' context menu items that you want to enable here (un-checked items are disabled)" `
"Tick the 'Send To' context menu items that you want to enable here (un-checked items are disabled)" `
"$($items.Keys -join ';')") -split ';'

# Loop through choices
Expand Down

0 comments on commit 9fb6732

Please sign in to comment.