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.2 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
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
BSOD Restart error code 0x000009f
I've got several BSOD with error code 0x000009f. Drivers are up to date. No new hardware have been connected. Please help.
BSOD Help and Support
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
Programs that require system restart
I seem to be having a problem with programs that require a system restart before installing, for instance Alcohol 120%; Daemon Tools; etc. They display a message saying that you need to restart your system before installing this software and you just press yes and the computer restarts...

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 10:38.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App