2021-01-10 23:14:52 +01:00
|
|
|
@echo off
|
2022-12-18 16:10:09 +01:00
|
|
|
|
|
|
|
rem ===================
|
|
|
|
rem GLOBAL VARS
|
|
|
|
rem ===================
|
|
|
|
|
2021-01-10 23:14:52 +01:00
|
|
|
set TOOLS=c:\tools
|
2022-12-13 16:29:35 +01:00
|
|
|
set SCRIPT_SETTINGS=%TOOLS%\scripts\settings.cmd
|
|
|
|
set COMPANY_SETTINGS=%TOOLS%\company\settings.cmd
|
2023-01-19 22:54:18 +01:00
|
|
|
set USERCONFIG_DONE="%LOCALAPPDATA%"\.userconfig_done
|
|
|
|
set EMLICENSE_DONE="%LOCALAPPDATA%"\.emlicense_done
|
|
|
|
set STARTMENU="%APPDATA%\Microsoft\Windows\Start Menu\Programs"
|
|
|
|
set STARTMENU_PUBLIC="%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs"
|
2022-12-18 16:23:03 +01:00
|
|
|
|
2022-12-18 16:10:09 +01:00
|
|
|
rem ===================
|
|
|
|
rem DEFAULTS
|
|
|
|
rem ===================
|
2021-01-10 23:14:52 +01:00
|
|
|
|
2021-04-11 22:15:21 +02:00
|
|
|
set bgcol_R=0
|
|
|
|
set bgcol_G=0
|
|
|
|
set bgcol_B=0
|
2022-12-18 16:10:09 +01:00
|
|
|
set LANG=en-US
|
|
|
|
set support_user=
|
|
|
|
set support_password=
|
|
|
|
set emclient_license=0
|
2022-12-23 20:35:22 +01:00
|
|
|
set seafile_domain=0
|
2023-01-12 18:23:03 +01:00
|
|
|
set install_aerolite=0
|
2023-01-15 18:22:39 +01:00
|
|
|
set preserve_savedgames_folder=0
|
2022-12-18 16:10:09 +01:00
|
|
|
|
2023-01-14 14:55:58 +01:00
|
|
|
echo ####### %0 #######
|
2022-12-18 16:23:03 +01:00
|
|
|
|
2022-12-13 16:29:35 +01:00
|
|
|
rem ===================
|
2022-12-18 16:10:09 +01:00
|
|
|
rem CONFIGFILE CHECKS
|
2022-12-13 16:29:35 +01:00
|
|
|
rem ===================
|
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo.
|
2022-12-13 16:29:35 +01:00
|
|
|
echo searching for SCRIPT settings ...
|
|
|
|
if NOT EXIST %SCRIPT_SETTINGS% (
|
2023-01-20 08:15:22 +01:00
|
|
|
echo INFO: config file %SCRIPT_SETTINGS% NOT FOUND
|
2022-12-13 16:29:35 +01:00
|
|
|
) else (
|
|
|
|
echo OK. Loading SCRIPT settings ...
|
|
|
|
call %SCRIPT_SETTINGS%
|
2022-12-18 16:10:09 +01:00
|
|
|
echo LANG=%LANG%
|
2021-04-02 18:46:28 +02:00
|
|
|
)
|
2022-12-13 16:29:35 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo.
|
2022-12-13 16:29:35 +01:00
|
|
|
echo searching for COMPANY settings ...
|
|
|
|
if NOT EXIST %COMPANY_SETTINGS% (
|
|
|
|
echo INFO: config file %COMPANY_SETTINGS% NOT FOUND
|
|
|
|
) else (
|
|
|
|
echo OK. Loading COMPANY settings ...
|
|
|
|
call %COMPANY_SETTINGS%
|
|
|
|
)
|
|
|
|
|
2023-01-14 14:55:58 +01:00
|
|
|
rem ================================================
|
|
|
|
rem GENERIC SETTINGS FOR THE USER (this runs always)
|
|
|
|
rem ================================================
|
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo.
|
|
|
|
echo #####
|
2023-01-14 14:55:58 +01:00
|
|
|
echo ##### GENERIC tasks and settings
|
2022-12-27 11:31:44 +01:00
|
|
|
echo #####
|
|
|
|
echo.
|
2022-12-18 16:23:03 +01:00
|
|
|
|
2023-01-20 08:15:22 +01:00
|
|
|
echo Setting desktop COLOUR ...
|
2021-04-02 18:46:28 +02:00
|
|
|
%TOOLS%\setbgcol %bgcol_R% %bgcol_G% %bgcol_B%
|
2021-01-10 23:14:52 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Starting BGInfo tool ...
|
2021-01-10 23:14:52 +01:00
|
|
|
%TOOLS%\bginfo\bginfo64.exe %TOOLS%\bginfo\config.bgi /NOLICPROMPT /silent /timer:0
|
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Setting RECYCLE BIN limits ...
|
|
|
|
echo.
|
2022-06-22 00:07:25 +02:00
|
|
|
powershell -command %TOOLS%\scripts\set-recyclebin.ps1
|
2022-12-27 11:31:44 +01:00
|
|
|
echo.
|
2022-05-29 13:46:27 +02:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Remapping Desktop folder to standard location ...
|
|
|
|
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" ^
|
2023-01-19 22:54:18 +01:00
|
|
|
/v Desktop /t REG_EXPAND_SZ /d "%USERPROFILE%\Desktop" /f 1>nul
|
2021-01-27 22:05:17 +01:00
|
|
|
|
2022-12-18 21:08:07 +01:00
|
|
|
if EXIST "%ProgramFiles%\Seafile\bin\seafile-applet.exe" (
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Setting autostart for SEAFILE client ...
|
|
|
|
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" ^
|
2022-12-18 21:08:07 +01:00
|
|
|
/v Seafile /t REG_SZ /d "%ProgramFiles%\Seafile\bin\seafile-applet.exe" /f 1>nul
|
|
|
|
)
|
|
|
|
|
2022-12-23 20:35:22 +01:00
|
|
|
rem fix for broken SEAFILE folder access rights ...
|
2023-01-19 22:54:18 +01:00
|
|
|
if EXIST "%USERPROFILE%"\Seafile (
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Removing "system" attribute on SEAFILE storage folder ...
|
2023-01-19 22:54:18 +01:00
|
|
|
attrib -S "%USERPROFILE%"\Seafile /S /D 1>nul 2>nul
|
2022-12-23 20:35:22 +01:00
|
|
|
)
|
2022-12-18 21:08:07 +01:00
|
|
|
|
2023-01-14 14:55:58 +01:00
|
|
|
rem ===================
|
|
|
|
rem EMCLIENT LICENSING
|
|
|
|
rem ===================
|
|
|
|
|
|
|
|
rem licensing for emClient already done ?
|
|
|
|
if EXIST %EMLICENSE_DONE% GOTO EMCLIENT_END
|
|
|
|
|
|
|
|
if %emclient_license% == 0 (
|
|
|
|
echo no emClient license found!
|
|
|
|
) else (
|
|
|
|
echo.
|
|
|
|
if EXIST "%ProgramFiles(x86)%\eM Client\MailClient.exe" (
|
|
|
|
echo Adding emClient license ...
|
|
|
|
"%ProgramFiles(x86)%\eM Client\MailClient.exe" /activate %emclient_license%
|
|
|
|
|
|
|
|
rem create a statusfile (this codeblock must be executed only once per use) ...
|
|
|
|
echo 1 >%EMLICENSE_DONE%
|
|
|
|
|
|
|
|
) else (
|
|
|
|
echo emClient is NOT installed!
|
|
|
|
)
|
|
|
|
echo.
|
|
|
|
)
|
|
|
|
|
|
|
|
:EMCLIENT_END
|
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
rem =====================================================
|
|
|
|
rem ACCOUNT TWEAKS AND CONFIG FILES (this runs only once)
|
|
|
|
rem =====================================================
|
2021-03-27 16:01:19 +01:00
|
|
|
|
2022-12-18 16:10:09 +01:00
|
|
|
rem User tweaks already done ?
|
|
|
|
if EXIST %USERCONFIG_DONE% GOTO USERTWEAKS_DONE
|
2021-01-30 21:38:46 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo.
|
|
|
|
echo #####
|
|
|
|
echo ##### INITIAL account setup
|
|
|
|
echo #####
|
|
|
|
echo.
|
|
|
|
|
2023-01-20 08:15:22 +01:00
|
|
|
rem ============
|
|
|
|
rem ADMIN RIGHTS
|
|
|
|
rem ============
|
2023-01-14 14:55:58 +01:00
|
|
|
|
|
|
|
isuseradmin
|
|
|
|
if %ERRORLEVEL% == 0 (
|
|
|
|
|
|
|
|
echo Disabling unwanted NETWORK features ...
|
|
|
|
call %TOOLS%\scripts\disable-networkfeatures.cmd 1>nul 2>nul
|
|
|
|
|
|
|
|
echo Cleaning up tiles in the START menu ...
|
|
|
|
call %TOOLS%\scripts\cleanup-tiles.cmd 1>nul 2>nul
|
|
|
|
|
|
|
|
rem ... stupid OS!
|
|
|
|
rem why the heck is the Startmenu entry for "System Tools" installed per user ? stupid Microsoft.
|
|
|
|
echo Moving system tools links ...
|
|
|
|
move /Y %STARTMENU%\"System Tools\*.*" ^
|
2023-01-15 17:52:06 +01:00
|
|
|
%STARTMENU_PUBLIC%\"System Tools" 2>nul
|
2023-01-14 14:55:58 +01:00
|
|
|
|
|
|
|
rem Removing and renaming objects in the "System Tools" folder...
|
|
|
|
move /Y %STARTMENU_PUBLIC%\"System Tools\computer.lnk" ^
|
|
|
|
%STARTMENU_PUBLIC%\"System Tools\This PC.lnk" 1>nul 2>nul
|
|
|
|
del /F %STARTMENU_PUBLIC%\"System Tools\Command Prompt.lnk" 2>nul
|
|
|
|
|
2023-01-15 17:52:06 +01:00
|
|
|
rem moving Powershell ISE icons ...
|
|
|
|
move /Y %STARTMENU_PUBLIC%\"Windows Powershell\Windows PowerShell ISE.lnk" ^
|
|
|
|
%STARTMENU_PUBLIC%\"System Tools" 2>nul
|
|
|
|
rd /S /Q %STARTMENU_PUBLIC%\"Windows Powershell"
|
|
|
|
|
2023-01-14 14:55:58 +01:00
|
|
|
)
|
|
|
|
|
2023-01-20 08:15:22 +01:00
|
|
|
rem ===========
|
|
|
|
rem USER RIGHTS
|
|
|
|
rem ===========
|
|
|
|
|
|
|
|
rem setting Aerolite theme...
|
|
|
|
if %install_aerolite% == 1 (
|
|
|
|
call %TOOLS%\scripts\modify-desktoptheme.cmd %bgcol_R% %bgcol_G% %bgcol_B%
|
|
|
|
echo.
|
|
|
|
)
|
|
|
|
|
2023-01-19 22:54:18 +01:00
|
|
|
echo Creating workspace folder ...
|
|
|
|
mkdir "%USERPROFILE%"\workspace 1>nul 2>nul
|
2021-03-14 23:14:01 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Setting up SSH client ...
|
2023-01-19 22:54:18 +01:00
|
|
|
mkdir "%USERPROFILE%"\.ssh 1>nul 2>nul
|
|
|
|
copy /Y %TOOLS%\scripts\config\ssh-config.txt "%USERPROFILE%"\.ssh\config 1>nul 2>nul
|
2021-03-14 23:14:01 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Installing a VIM configuration ...
|
2023-01-19 22:54:18 +01:00
|
|
|
copy /Y %TOOLS%\scripts\config\vimrc.txt "%USERPROFILE%"\.vimrc 1>nul 2>nul
|
2021-01-27 22:05:17 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Setting up WINDOWS TERMINAL ...
|
2023-01-19 22:54:18 +01:00
|
|
|
set LOCALSTATE="%LOCALAPPDATA%"\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
|
2022-12-18 16:10:09 +01:00
|
|
|
mkdir %LOCALSTATE% 1>nul 2>nul
|
2022-12-27 11:31:44 +01:00
|
|
|
copy /Y %TOOLS%\scripts\config\wt-settings.json %LOCALSTATE%\settings.json 1>nul 2>nul
|
2021-02-03 13:37:54 +01:00
|
|
|
|
2022-12-18 16:30:08 +01:00
|
|
|
rem TOTALCOMMANDER
|
2023-01-19 22:54:18 +01:00
|
|
|
mkdir "%APPDATA%"\GHISLER 1>nul 2>nul
|
|
|
|
if NOT EXIST "%APPDATA%"\GHISLER\WINCMD.ini (
|
2023-01-16 09:02:34 +01:00
|
|
|
echo Copying standard inifile for TOTALCOMMANDER ...
|
2023-01-19 22:54:18 +01:00
|
|
|
copy /Y %TOOLS%\optional\config\WINCMD.ini "%APPDATA%"\GHISLER 1>nul 2>nul
|
2023-01-16 09:02:34 +01:00
|
|
|
)
|
2023-01-19 22:54:18 +01:00
|
|
|
if NOT EXIST "%APPDATA%"\GHISLER\wcx_ftp.ini (
|
2023-01-16 09:02:34 +01:00
|
|
|
echo Copying standard TOTALCOMMANDER ftp config file ...
|
2023-01-19 22:54:18 +01:00
|
|
|
copy /Y %TOOLS%\optional\config\wcx_ftp.ini "%APPDATA%"\GHISLER 1>nul 2>nul
|
2023-01-16 09:02:34 +01:00
|
|
|
)
|
2022-12-18 16:30:08 +01:00
|
|
|
|
2021-04-12 12:54:46 +02:00
|
|
|
echo Adding "This PC" icon for current user on desktop Windows 10 ...
|
2022-12-27 11:31:44 +01:00
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" ^
|
2021-02-14 20:35:35 +01:00
|
|
|
/v "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /t REG_DWORD /d 0 /f 1>nul
|
2022-12-27 11:31:44 +01:00
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" ^
|
2021-02-14 20:35:35 +01:00
|
|
|
/v "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /t REG_DWORD /d 0 /f 1>nul
|
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Refreshing the desktop (W10 style) ...
|
2021-02-14 20:35:35 +01:00
|
|
|
ie4uinit.exe -show
|
2021-02-13 20:05:56 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Adding "seconds" display to clock ...
|
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" ^
|
2021-02-14 20:58:44 +01:00
|
|
|
/v "ShowSecondsInSystemClock" /t REG_DWORD /d 1 /f 1>nul
|
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Setting the "GLOBAL" view mode for windows EXPLORER ...
|
|
|
|
echo.
|
2022-06-22 00:07:25 +02:00
|
|
|
powershell -command %TOOLS%\scripts\set-explorer-viewmode.ps1
|
2022-12-27 11:31:44 +01:00
|
|
|
echo.
|
2022-05-29 10:55:54 +02:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Enabling the "show file extensions" feature in explorer ...
|
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" ^
|
2022-05-29 10:55:54 +02:00
|
|
|
/v "HideFileExt" /t REG_DWORD /d 0 /f 1>nul
|
|
|
|
|
|
|
|
echo Do not add "-Shortcut" text to the name of newly created shortcuts ...
|
2022-12-27 11:31:44 +01:00
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" ^
|
2022-05-29 10:55:54 +02:00
|
|
|
/v "link" /t REG_BINARY /d "00000000" /f 1>nul
|
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Disabling the search box on the taskbar ...
|
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Search" ^
|
2021-02-13 22:04:02 +01:00
|
|
|
/v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f 1>nul
|
2021-02-13 20:05:56 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Disabling the multi tasking view button on the taskbar ...
|
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" ^
|
2021-02-13 22:04:02 +01:00
|
|
|
/v "ShowTaskViewButton" /t REG_DWORD /d 0 /f 1>nul
|
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Disabling the cortana button on the taskbar ...
|
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" ^
|
2021-02-13 22:04:02 +01:00
|
|
|
/v "ShowCortanaButton" /t REG_DWORD /d 0 /f 1>nul
|
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Loading the OpenShell configuration ...
|
2021-03-02 14:01:12 +01:00
|
|
|
rem config must be full qualified pathname (OpenShell BUG!)
|
|
|
|
set CONFIG=%TOOLS%\scripts\config\OpenshellSettings.xml
|
2021-03-30 21:21:53 +02:00
|
|
|
"%ProgramFiles%"\Open-Shell\StartMenu.exe -xml %CONFIG%
|
2021-03-02 14:01:12 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo.
|
|
|
|
echo Removing the "user" folders from the explorer navigation pane ...
|
2021-03-31 00:22:47 +02:00
|
|
|
for %%K in (
|
|
|
|
{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}
|
|
|
|
{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}
|
|
|
|
{D3162B92-9365-467A-956B-92703ACA08AF}
|
|
|
|
{088E3905-0323-4B02-9826-5D99428E115F}
|
|
|
|
{3DFDF296-DBEC-4FB4-81D1-6A3438BCF4DE}
|
|
|
|
{24AD3AD4-A569-4530-98E1-AB02F9417AA8}
|
|
|
|
{F86FA3AB-70D2-4FC7-9C99-FCBF05467F3A}
|
|
|
|
) do (
|
|
|
|
echo %%K
|
2022-12-27 11:31:44 +01:00
|
|
|
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideMyComputerIcons" ^
|
2021-03-31 00:22:47 +02:00
|
|
|
/v "%%K" /t REG_DWORD /d 1 /f 1>nul
|
|
|
|
)
|
2022-12-27 11:31:44 +01:00
|
|
|
echo.
|
2021-03-31 00:22:47 +02:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Adding the home folder to the explorer navigation pane ...
|
|
|
|
reg add "HKCU\Software\Classes\CLSID\{59031a47-3f72-44a7-89c5-5595fe6b30ee}" ^
|
2021-03-31 00:22:47 +02:00
|
|
|
/v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 1 /f 1>nul
|
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Make explorer show "This PC" on top ...
|
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" ^
|
2021-03-31 09:21:52 +02:00
|
|
|
/v "LaunchTo" /t REG_DWORD /d 1 /f 1>nul
|
|
|
|
|
2021-04-12 12:54:46 +02:00
|
|
|
echo Cleaning up recent files and libraries ...
|
2023-01-19 22:54:18 +01:00
|
|
|
del /F /Q "%APPDATA%"\Microsoft\Windows\Recent\AutomaticDestinations\* 2>nul
|
|
|
|
del /F /Q "%APPDATA%"\Microsoft\Windows\Recent\* 2>nul
|
|
|
|
del /F /Q "%APPDATA%"\Microsoft\Windows\Libraries\* 2>nul
|
2021-03-31 22:36:57 +02:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Disabling frequent and recent files view in explorer ...
|
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" ^
|
2021-04-22 12:24:48 +02:00
|
|
|
/v "ShowRecent" /t REG_DWORD /d 0 /f 1>nul
|
2022-12-27 11:31:44 +01:00
|
|
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" ^
|
2021-04-22 12:24:48 +02:00
|
|
|
/v "ShowFrequent" /t REG_DWORD /d 0 /f 1>nul
|
|
|
|
|
2022-12-24 15:56:30 +01:00
|
|
|
echo.
|
2022-12-27 11:31:44 +01:00
|
|
|
echo preparing the SEAFILE configuration
|
|
|
|
echo ########################################
|
2022-12-24 15:56:30 +01:00
|
|
|
echo.
|
2022-12-23 20:35:22 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo setting path for filestore ...
|
|
|
|
reg add "HKCU\SOFTWARE\SeaFile" ^
|
2022-12-23 20:35:22 +01:00
|
|
|
/v "PreconfigureDirectory" /d "%USERPROFILE%" /t REG_SZ /f 1>nul
|
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo guessing SEAFILE username and setting a dummy token...
|
2022-12-23 20:35:22 +01:00
|
|
|
if seafile_domain == 0 (
|
|
|
|
echo no SeaFile domain found - cannot guess username!
|
|
|
|
) else (
|
2022-12-27 11:31:44 +01:00
|
|
|
reg add "HKCU\SOFTWARE\SeaFile" ^
|
2022-12-23 20:35:22 +01:00
|
|
|
/v "PreconfigureUsername" /d "%USERNAME%@%seafile_domain%" /t REG_SZ /f 1>nul
|
2022-12-27 11:31:44 +01:00
|
|
|
reg add "HKCU\SOFTWARE\SeaFile" ^
|
|
|
|
/v "PreconfigureUserToken" /d "dummy" /t REG_SZ /f 1>nul
|
2022-12-23 20:35:22 +01:00
|
|
|
)
|
|
|
|
|
2021-03-02 13:57:45 +01:00
|
|
|
echo.
|
2022-12-24 15:56:30 +01:00
|
|
|
echo reorganizing start menu and desktop
|
2021-04-02 14:40:56 +02:00
|
|
|
echo ########################################
|
2021-03-14 12:35:41 +01:00
|
|
|
echo.
|
|
|
|
|
2022-12-26 22:32:53 +01:00
|
|
|
echo Removing OneDrive link in start menu ...
|
2023-01-19 22:54:18 +01:00
|
|
|
del /F /Q "%APPDATA%\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" 2>nul
|
2022-12-26 22:32:53 +01:00
|
|
|
|
2022-12-24 15:56:30 +01:00
|
|
|
rem create a statusfile (this codeblock must be executed only once per user) ...
|
|
|
|
echo 1 >%USERCONFIG_DONE%
|
|
|
|
|
|
|
|
:USERTWEAKS_DONE
|
|
|
|
|
|
|
|
rem ========================================
|
|
|
|
rem ACCOUNT CLEANUP AND FIXES (runs always)
|
|
|
|
rem ========================================
|
|
|
|
|
2021-04-12 12:54:46 +02:00
|
|
|
echo.
|
2022-12-24 15:56:30 +01:00
|
|
|
echo #####
|
|
|
|
echo ##### CLEANUP
|
|
|
|
echo #####
|
2021-03-14 11:53:43 +01:00
|
|
|
|
2023-01-20 08:15:22 +01:00
|
|
|
rem ============
|
|
|
|
rem ADMIN RIGHTS
|
|
|
|
rem ============
|
2022-12-13 16:29:35 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
isuseradmin
|
|
|
|
if %ERRORLEVEL% == 0 (
|
2023-01-14 14:55:58 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo.
|
|
|
|
call %TOOLS%\scripts\uninstall-onedrive.cmd
|
2023-01-14 14:55:58 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo.
|
|
|
|
call %TOOLS%\scripts\uninstall-edge.cmd
|
2023-01-14 14:55:58 +01:00
|
|
|
|
2022-12-27 11:31:44 +01:00
|
|
|
echo.
|
|
|
|
call %TOOLS%\scripts\uninstall-pchealth.cmd
|
|
|
|
|
2023-01-14 14:55:58 +01:00
|
|
|
rem ... stupid OS!
|
|
|
|
rem why the heck is the Startmenu entry for "Accessibility Tools" installed per user ? stupid Microsoft.
|
|
|
|
rem must be done (here) more than once, because Microsoft patches can reinstall some tools ...
|
|
|
|
echo.
|
|
|
|
echo Moving accessibility tools to accessories folder ...
|
|
|
|
move /Y %STARTMENU%\"Accessibility\*.*" ^
|
|
|
|
%STARTMENU_PUBLIC%\Accessories 2>nul
|
|
|
|
|
|
|
|
move /Y %STARTMENU_PUBLIC%\"Accessibility\*.*" ^
|
|
|
|
%STARTMENU_PUBLIC%\Accessories 2>nul
|
|
|
|
|
|
|
|
echo Removing public accessibility tools folder ...
|
|
|
|
rd /S /Q %STARTMENU_PUBLIC%\Accessibility 2>nul
|
|
|
|
|
2023-01-15 17:52:06 +01:00
|
|
|
echo Moving "settings" link to system tools folder ...
|
2023-01-15 18:22:39 +01:00
|
|
|
attrib -S %STARTMENU_PUBLIC%\"Immersive Control Panel.lnk" 1>nul 2>nul
|
2023-01-15 17:52:06 +01:00
|
|
|
move /Y %STARTMENU_PUBLIC%\"Immersive Control Panel.lnk" ^
|
|
|
|
%STARTMENU_PUBLIC%\"System Tools" 2>nul
|
|
|
|
|
2023-01-14 14:55:58 +01:00
|
|
|
) else (
|
|
|
|
|
2023-01-20 08:15:22 +01:00
|
|
|
rem ===========
|
|
|
|
rem USER RIGHTS
|
|
|
|
rem ===========
|
|
|
|
|
2023-01-14 14:55:58 +01:00
|
|
|
echo Removing accessibility tools folder ...
|
|
|
|
rd /S /Q %STARTMENU%\Accessibility 2>nul
|
2021-03-14 12:35:41 +01:00
|
|
|
|
2023-01-14 14:55:58 +01:00
|
|
|
echo Removing users accessories folder ...
|
|
|
|
rd /S /Q %STARTMENU%\Accessories 2>nul
|
|
|
|
|
|
|
|
echo Removing users system tools folder ...
|
|
|
|
rd /S /Q %STARTMENU%\"System Tools" 2>nul
|
|
|
|
|
|
|
|
)
|
2022-12-24 15:56:30 +01:00
|
|
|
|
2023-01-20 08:15:22 +01:00
|
|
|
rem ===========
|
|
|
|
rem USER RIGHTS
|
|
|
|
rem ===========
|
|
|
|
|
2022-12-24 15:56:30 +01:00
|
|
|
echo.
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Cleaning users home directory
|
2022-12-24 15:56:30 +01:00
|
|
|
echo ########################################
|
|
|
|
echo.
|
|
|
|
|
|
|
|
rem WARNING!
|
|
|
|
rem DO NOT remove the "PICTURES" folder!
|
|
|
|
rem this is used and needed by the snipping tool!
|
|
|
|
|
2023-01-15 18:22:39 +01:00
|
|
|
echo removing folder "3D Objects" ...
|
2023-01-19 22:54:18 +01:00
|
|
|
rd /S /Q "%USERPROFILE%\3D Objects" 2>nul
|
2021-03-06 15:10:45 +01:00
|
|
|
|
2023-01-15 18:22:39 +01:00
|
|
|
echo removing folder "Links" ...
|
2023-01-19 22:54:18 +01:00
|
|
|
rd /S /Q "%USERPROFILE%\Links" 2>nul
|
2022-09-25 14:49:06 +02:00
|
|
|
|
2023-01-15 18:22:39 +01:00
|
|
|
if %preserve_savedgames_folder% == 0 (
|
|
|
|
echo removing folder "Saved Games" ...
|
2023-01-19 22:54:18 +01:00
|
|
|
rd /S /Q "%USERPROFILE%\Saved Games" 2>nul
|
2023-01-15 18:22:39 +01:00
|
|
|
)
|
2021-03-06 15:10:45 +01:00
|
|
|
|
2023-01-15 18:22:39 +01:00
|
|
|
echo removing folder "Searches" ...
|
2023-01-19 22:54:18 +01:00
|
|
|
rd /S /Q "%USERPROFILE%\Searches" 2>nul
|
2021-10-10 16:58:56 +02:00
|
|
|
|
|
|
|
for %%D in (
|
|
|
|
|
|
|
|
Contacts
|
|
|
|
Documents
|
|
|
|
Favorites
|
|
|
|
Music
|
|
|
|
Searches
|
|
|
|
Videos
|
|
|
|
|
|
|
|
) do (
|
|
|
|
|
|
|
|
echo %%D ...
|
2023-01-19 22:54:18 +01:00
|
|
|
attrib -R -S -H "%USERPROFILE%"\%%D 1>nul 2>nul
|
|
|
|
attrib -R -S -H "%USERPROFILE%"\%%D\desktop.ini 1>nul 2>nul
|
|
|
|
del /F /Q "%USERPROFILE%"\%%D\desktop.ini 2>nul
|
|
|
|
rmdir /Q "%USERPROFILE%"\%%D 2>nul
|
2021-10-10 16:58:56 +02:00
|
|
|
|
|
|
|
)
|
2021-03-06 15:10:45 +01:00
|
|
|
|
2023-01-15 18:22:39 +01:00
|
|
|
echo.
|
|
|
|
echo Other tasks and fixes for the user
|
|
|
|
echo ########################################
|
|
|
|
echo.
|
|
|
|
|
|
|
|
echo Removing even more startmenu crap ...
|
2023-01-15 17:52:06 +01:00
|
|
|
rd /S /Q %STARTMENU%\"Accessories" 2>nul
|
|
|
|
rd /S /Q %STARTMENU%\"Accessibility" 2>nul
|
|
|
|
rd /S /Q %STARTMENU%\"Administrative Tools" 2>nul
|
|
|
|
rd /S /Q %STARTMENU%\"Maintenance" 2>nul
|
|
|
|
rd /S /Q %STARTMENU%\"System Tools" 2>nul
|
|
|
|
rd /S /Q %STARTMENU%\"Windows Powershell" 2>nul
|
|
|
|
|
2023-01-14 14:55:58 +01:00
|
|
|
rem ... stupid OS!
|
|
|
|
rem IE is such a zombie. I's coming back all the time ...
|
|
|
|
echo Removing IE link in users start menu ...
|
|
|
|
del /F %STARTMENU%\"Accessories\Internet Explorer.lnk" 2>nul
|
|
|
|
|
|
|
|
rem ... stupid OS!
|
|
|
|
rem Edge is a zombie too!
|
|
|
|
echo Removing microsoft edge links in start menu and desktop ...
|
|
|
|
del /F %STARTMENU%\"Microsoft Edge.lnk" 2>nul
|
2023-01-19 22:54:18 +01:00
|
|
|
del /F "%USERPROFILE%\Desktop\Microsoft Edge.lnk" 2>nul
|
2023-01-14 14:55:58 +01:00
|
|
|
|
|
|
|
rem re-create "Pictures" in case it was deleted ...
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Creating "Pictures" folder for snipping tool ...
|
2023-01-19 22:54:18 +01:00
|
|
|
mkdir "%USERPROFILE%"\Pictures 2>nul
|
2022-09-25 15:05:22 +02:00
|
|
|
|
2023-01-14 14:55:58 +01:00
|
|
|
rem workstation service should run always ...
|
2023-01-15 18:22:39 +01:00
|
|
|
echo.
|
2022-12-27 11:31:44 +01:00
|
|
|
echo Starting the workstation service ...
|
2021-01-10 23:14:52 +01:00
|
|
|
net start workstation 1>nul 2>nul
|
|
|
|
net config workstation
|
|
|
|
|
|
|
|
echo ####### %0 #######
|
2021-03-30 21:21:53 +02:00
|
|
|
|
|
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
|
|
echo # unknown ERROR! #
|
|
|
|
echo ####### %0 #######
|
|
|
|
echo.
|
|
|
|
pause
|
|
|
|
)
|
2021-01-10 23:14:52 +01:00
|
|
|
|