@echo off
CLS
SET "Admin="
color 1f
TITLE Desktop Icons - Checking for Admin...
echo.
cd %systemroot%\system32
call :IsAdmin

TITLE Add/Remove Desktop Icons - Default Settings.
cls
color 1F
echo.
SET "UF=1" & SET "CP=1" & SET "NW=1" & SET "RB=0" & SET "PC=1"
SET "UFT=No" & SET "CPT=No" & SET "NWT=No" & SET "RBT=Yes" & SET "PCT=No"

:loop
cls
CALL :Display

SET /p "UF=Show User's Folder On Desktop {Y/N and press enter - default No} "
IF /I "%UF%" NEQ "Y" SET "UF=1" & SET "UFT=No"
IF /I "%UF%"=="Y" SET "UF=0" & SET "UFT=Yes"

TITLE Add/Remove Desktop Icons - Edited Settings.

CALL :Display
SET /p "CP=Show Control Panel On Desktop {Y/N and press enter - default No} "
IF /I "%CP%" NEQ "Y" SET "CP=1" & SET "CPT=No"
IF /I "%CP%"=="Y" SET "CP=0" & SET "CPT=Yes"

CALL :Display
SET /p "NW=Show Network On Desktop {Y/N and press enter - default No} "
IF /I "%NW%" NEQ "Y" SET "NW=1" & SET "NWT=No"
IF /I "%NW%"=="Y" SET "NW=0" & SET "NWT=Yes"

CALL :Display
SET /p "RB=Show Recycle Bin On Desktop {Y/N and press enter - default No} "
IF /I "%RB%" NEQ "Y" SET "RB=1" & SET "RBT=No"
IF /I "%RB%"=="Y" SET "RB=0" & SET "RBT=Yes"

CALL :Display
SET /p "PC=Show This PC/ My Computer On Desktop {Y/N and press enter - default No} "
IF /I "%PC%" NEQ "Y" SET "PC=1" & SET "PCT=No"
IF /I "%PC%"=="Y" SET "PC=0" & SET "PCT=Yes"

CALL :Display

echo.
SET /p "OK=Happy with settings {Y/N and press enter - default No} "
IF /I "%OK%"=="Y" GOTO :ActionThem

GOTO :loop

:actionthem
rem ** Desktop Icons -- 0 = Show Icon , 1 = Hide Icon **
rem User's Files
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" /t REG_DWORD /d "%UF%" /f >nul 2>&1

rem Control Panel
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}" /t REG_DWORD /d "%CP%" /f >nul 2>&1

rem Network
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" /t REG_DWORD /d "%NW%" /f >nul 2>&1

rem Recycle Bin (usually shown by default)
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{645FF040-5081-101B-9F08-00AA002F954E}" /t REG_DWORD /d "%RB%" /f >nul 2>&1

rem This PC/My Computer
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /t REG_DWORD /d "%PC%" /f >nul 2>&1



echo Desktop Icon Settings Completed. A log out or reboot is required.
echo.
pause
exit

=====================================================================================
:IsAdmin
Reg.exe query "HKU\S-1-5-19\Environment"
If Not %ERRORLEVEL% EQU 0 (
 Cls & echo. & Echo You must have administrator rights to continue ... & echo.
 Pause & Exit
)
Cls
exit /b

:Display
cls
echo ===================================
echo Current Settings  - Show On Desktop
echo ===================================
echo User's Folder     :  %UFT%
echo Control Panel     :  %CPT%
echo Network           :  %NWT%
echo Recycle Bin       :  %RBT%
echo ThisPC/My Comp    :  %PCT%

echo.
exit /b