-1

First of all, I'm a total newbie when it comes to coding and therefore must have missed something when searching on the web or I must have made some mistake in my previous attempts to make this script.

Anyways, my problem is this:

For my little brother, we have an education learning tool that runs on Windows. (Located at: C:\Program Files (x86)\AmbraSoft\hoofdmenu.exe).
I'm trying to make a script that kills explorer.exe (so he can't do anything else besides using the tool), then launches the learning tool and shuts down the computer when the tool (process: hoofdmenu.exe) is closed.

New as I am to coding I tried this:

taskkill /f /im explorer.exe
START /wait C:\Program Files (x86)\AmbraSoft\hoofdmenu.exe
shutdown.exe /s /t 00

But that doesn't seem to work because the program hoofdmenu.exe won't start. It will start when I a make a Task in the Windows Taskscheduler though. I have also tried to add " before and after the filepath but that has not worked either.

Can somebody please tell this newbie what I'm doing wrong here?

user692942
  • 16,398
  • 7
  • 76
  • 175
Noah
  • 9
  • 2

2 Answers2

0

You need to surround the path with quotes if it contains spaces.

START /wait "C:\Program Files (x86)\AmbraSoft\hoofdmenu.exe"
user692942
  • 16,398
  • 7
  • 76
  • 175
Foxtrot
  • 607
  • 4
  • 10
  • This isn't the first time someone has asked how to execute a path that contains spaces, just duplicate flag and move on. – user692942 Feb 20 '17 at 08:58
0

Because the provided answer has an issue:

Start "" /Wait "C:\Program Files (x86)\AmbraSoft\hoofdmenu.exe"

Or:

Start "" /Wait "%ProgramFiles(x86)%\AmbraSoft\hoofdmenu.exe"
Compo
  • 36,585
  • 5
  • 27
  • 39