wir hatten das Thema Desktop Icon Anordnung hier schon einige Male:
viewtopic.php?t=34035
oder hier:
viewtopic.php?p=454334
der Desktop Restore von MIDIOX
http://www.midiox.com/desktoprestore.htm hat leider bei mir nicht immer zuverlässig funktioniert.
Deshalb suchte ich eine andere Lösung, um das Ganze per Script zu automatisieren (z.B. mit einer Firstlogon.cmd).
Ich bin jetzt soweit zufrieden und stelle euch meine Scripte hier zur Verfügung. Vlt. kann ja jemand da etwas mit anfangen.
Genutzt wird das Programm "
Restore Desktop Icon Layouts" von Sordum
https://www.sordum.org/downloads/?resto ... on-layouts
Das Backup Script lädt die Datei ReIcon.zip aus dem Internet herunter (sofern nicht schon vorhanden) und entpackt sie in einen Temp Ordner. Sodann wird ein Backup vom aktuellen Zustand des Desktops gemacht (Anordnung der Verknüpfungen) und ebenfalls im TEMP Ordner abgelegt. Der Name des Ordner und der Datei wird euch auch noch am Ende des Scripts angezeigt.
Das Restore Script nimmt die im Temp Ordner erstellte IconLayoutsForXXXXX.ini und stellt damit die Anordnung der Desktop Icons wieder her. Nachträglich des Backups erstellte Icons werden mit dem Restore also nicht erfasst und verbleiben an ihrem Ort auf dem Desktop.
Wenn ihr hin und wieder euren Temp Ordner löschen sollte, könnt ihr natürlich auch einen anderen Ordner mit dem Script vorgeben. Also in beiden Scripten ändern.
Gerne bin ich bei Anpassungswünschen behilflich.
Viel Spaß!
Backup Restore Icon Layout.zip
Backup Icon Layout.cmd
Code: Alles auswählen
@echo off
chcp 1252 >nul
setlocal EnableExtensions DisableDelayedExpansion
:: 1. Prüfen, ob wir bereits Admin sind
net session >nul 2>&1
if %errorLevel% == 0 (
goto :admin_ok
) else (
echo Fordere Administratorrechte an...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
:admin_ok
:: Ab hier läuft das Skript mit Admin-Rechten
echo Skript wird als Administrator ausgefuehrt.
pushd "%CD%"
cd /d "%~dp0"
cls
:Download_and_install
if exist "%~dp0ReIcon.zip" goto Expand
echo Downloading restore-desktop-icon-layouts File
powershell -NoLogo -NoProfile -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.sordum.org/files/download/restore-desktop-icon-layouts/ReIcon.zip', '%~dp0ReIcon.zip')"
if not exist "%~dp0ReIcon.zip" goto Fehler
:Expand
set "Expand_Folder=%LocalAppData%\Temp"
if exist "%Expand_Folder%\ReIcon\ReIcon_x64.exe" goto Action
if not exist "%Expand_Folder%" mkdir "%Expand_Folder%" >nul 2>&1
set "ZIP_File=%~dp0ReIcon.zip"
echo Entpacke ZIP-File...
powershell -NoProfile -ExecutionPolicy Bypass -Command "Expand-Archive -LiteralPath '%ZIP_File%' -DestinationPath '%Expand_Folder%' -Force" >nul 2>nul
:Action
if exist "%Expand_Folder%\ReIcon\ReIcon_x64.exe" (
"%Expand_Folder%\ReIcon\ReIcon_x64.exe" /S
)
if not exist "%Expand_Folder%\ReIcon\ReIcon_x64.exe" (
goto Fehler
)
:next
echo fertisch!
echo die ICON Datei befindet sich im Ordner "%Expand_Folder%\ReIcon\"
echo und hat den Namen IconLayoutsFor%UserName%.ini
pause
explorer.exe "%Expand_Folder%\ReIcon\"
exit /b
:Fehler
echo kein Download gefunden
pause >nul
exit /b 1
Restore Icon Layout.cmd
Code: Alles auswählen
@echo off
chcp 1252 >nul
setlocal EnableExtensions DisableDelayedExpansion
:: 1. Prüfen, ob wir bereits Admin sind
net session >nul 2>&1
if %errorLevel% == 0 (
goto :admin_ok
) else (
echo Fordere Administratorrechte an...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
:admin_ok
:: Ab hier läuft das Skript mit Admin-Rechten
echo Skript wird als Administrator ausgefuehrt.
pushd "%CD%"
cd /d "%~dp0"
cls
:Download_and_install
if exist "%~dp0ReIcon.zip" goto Expand
echo Downloading restore-desktop-icon-layouts File
powershell -NoLogo -NoProfile -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.sordum.org/files/download/restore-desktop-icon-layouts/ReIcon.zip', '%~dp0ReIcon.zip')"
if not exist "%~dp0ReIcon.zip" goto Fehler
:Expand
set "Expand_Folder=%LocalAppData%\Temp"
if exist "%Expand_Folder%\ReIcon\ReIcon_x64.exe" goto Action
if not exist "%Expand_Folder%" mkdir "%Expand_Folder%" >nul 2>&1
set "ZIP_File=%~dp0ReIcon.zip"
echo Entpacke ZIP-File...
powershell -NoProfile -ExecutionPolicy Bypass -Command "Expand-Archive -LiteralPath '%ZIP_File%' -DestinationPath '%Expand_Folder%' -Force" >nul 2>nul
:Action
if exist "%Expand_Folder%\ReIcon\ReIcon_x64.exe" (
"%Expand_Folder%\ReIcon\ReIcon_x64.exe" /R
)
if not exist "%Expand_Folder%\ReIcon\ReIcon_x64.exe" (
goto Fehler
)
:next
echo fertisch!
echo die Icons auf dem Desktop wurden wieder in Position gebracht
pause
exit /b
:Fehler
echo kein Download gefunden
pause >nul
exit /b 1