Using && ensures the second part only runs if the first part succeeds.
taskkill /f /im explorer.exe start explorer.exe
In addition to using the command line, there are other methods to restart Windows Explorer: