Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: How to code a bat file to restart explorer and 2 programs

22 May 2012   #1

Windows 7 Ultimate 32-bit
How to code a bat file to restart explorer and 2 programs

I am trying to write this program in notepad.exe.

What am I doing wrong? The code stops after explorer.exe is restarted. I know this because the command prompt does not show the echo "-explorer restarted". When I look at the command prompt, the cursor seems to be on the next line, but without the normal C:\Users\JohnSmith> in front of it (there is nothing in front of the cursor).

Also, if I include the command "exit" at the end of my .bat file, it doesn't seem to work. Even though if I type in exit into command prompt, the window closes.

Please help.

My System SpecsSystem Spec
22 May 2012   #2

W7 Ultimate SP1, LM18.3 MATE, W10 Home, #All 64 bit
Start Command

I think that you may need to use the "start" command.

Try these links:
Batch Files - Start Multiple Programs At Once

My System SpecsSystem Spec
22 May 2012   #3

W10 Pro desktop, W10 laptop, W10 laptop, W10 Pro tablet (all 64-bit)

You need to use the Start command, without it the bat file processes lines serially so it will wait until the explorer.exe command has "completed" before executing the next line.
My System SpecsSystem Spec


 How to code a bat file to restart explorer and 2 programs

Thread Tools

Similar help and support threads
Thread Forum
Open File Location Does Nothing EXCEPT during explorer restart???
I recently installed windows 7 on an older e machines T5216 running XP. I used PCMover to move my applications and settings, so at first, it was a clean 7 install. After all was done, I noticed I could not open a file location neither from the right-click menu nor the properties dialog. I...
General Discussion
File Explorer not responding when searching for programs and files
When I want to search something at start (when pressing the start button) it keeps saying "File Explorer is not responding", or I guess it's that. I have a dutch computer so it actually says "Windows verkenner reageert niet". When I want to search for programs and files, it freezes. I tried Fix it,...
General Discussion
SysTray Icons of some programs don't re-appear after Explorer restart
Hi there. I'm wondering why the system tray icons of some programs do not re-appear after restarting Windows Explorer. Examples of programs where this behavior occur are Ditto (clipboard manager) and Magic Disc (virtual optical drive). Note that they are still running, the icons just didn't...
General Discussion
Restart without closing programs?
Hi All, I have a question that I have been unable to solve but first I will start off by saying I am running boot camp on a mac, just so there is no confusion. I am an architecture student and am using a program called Revit to render 3D models regularly. Due to the long render times find myself...
General Discussion
Restart without closing programs?
Is there a way to force Windows to save a programs progress (ie a rendering program such as Revit) and restart, similar to the actions it takes before the computer shuts down after the battery has died?
Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 19:50.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App