Following creates a "Restart Explorer.exe" context menu (doing right click on Desktop).
If you wonder what the /v:on
switch does, it turns on Delayed Expansion which by default is turned off. It does expand %WINDIR%
at the execution time.
reg add "HKCR\Directory\Background\shell\Restart Explorer.exe\Command" /ve /d "cmd /v:on /c """taskkill /f /im explorer.exe ^& start ^!windir^!\explorer.exe""""
While CMD.exe is a command-line interpreter (CLI), EXPLORER.exe is a Windows shell.