Over 2 years later, I finally figured out how to do what I was originally attempting to do via cmd prompt: restart windows explorer with a default set of open windows, opened in the same order each time, and all under the same explorer instance/process!
Here's the solution, which uses two files (so that there are no cmd windows left open once the process completes), and one shortcut.
Save the following as RestartExplorer.bat on your desktop:
taskkill /F /IM explorer.exe ping -n 2 localhost>nul start "" cmd /c "%userprofile%\Desktop\RunExplorerDefaultWindows.bat"
Then save this as RunExplorerDefaultWindows.bat on your desktop:
%windir%\explorer.exe ping -n 3 localhost>nul start "" "%userprofile%\Documents" && ping -n 2 localhost>nul && start "" "%userprofile%\Downloads" && ping -n 2 localhost>nul && start "" "%userprofile%\Music" && ping -n 2 localhost>nul && start "" "%userprofile%\Pictures" && ping -n 2 localhost>nul && start "" "%userprofile%\Videos" exit
Last, make a shortcut to the RestartExplorer.bat file, and in the properties for the shortcut (alt+Enter), click Advanced, and check the Run as administrator box.
To run the process, just double-click on the RestartExplorer.bat shorctut!
I realized that having all of the commands on the same line, each separated by && , would result in each new window being opened under the same instance of explorer, rather than a new explorer instance/process being launched for each window (which happens when using a new line for each start command).
With this, anytime you reach a critical mass of open windows (the point where it becomes hard to find/switch to the one you want), you have a way of quickly reopening a default set of them, and they'll be in the same order on the taskbar every time, thus making it faster and easier to find/switch to the window you want.
And to customize which folders will be opened each time, you can simply change any of the "%userprofile%\folder" paths in the RunExplorerDefaultWindows.bat file to be whichever folder(s) you want for your default set.
shell.applicationcom object. What has you wedded tocmd.exe?