Error 0xc0000142 on Windows 10

M

MarkDear

I am tech support in a corporate environment with hundreds of machines.

I have a batch file which contains this line:

cmd.exe /C start C:\Progra~2\Micros~2\Office15\EXCEL.exe

which launches 32 bit MS Excel on my Windows 7 machine.

Now, I need to do the same thing with 64 bit Excel on my Windows 10 laptop, so naturally I go with


cmd.exe /C start C:\Progra~1\Micros~2\root\Office16\EXCEL.exe

which instantly gets me the message:

"Application Error. The application was unable to start correctly (0xc0000142). Click OK to close the application."

After some investigation, I discover that I cannot use the ~ path notation. Instead I must use the full length path name, and enclose it in quotes. Because the 'start' command interprets the first string parameter as a title for the window, I have to include a dummy string in quotes immediately after the 'start' command so that interprets the second string parameter as the path to the Excel executable, and the program to be executed. Also, each double quote must be escaped with a caret ^. So, I end up with this:


cmd.exe /C start ^"^" ^"C:\Program Files\Microsoft Office\root\Office16\EXCEL.exe^"



Although this is an adequate workaround, why can I not just use the short ~ notation pathnames, and keep the script tidy?

Notes:

1. This happens on multiple machines, every machine tested in fact.

2. This also occurs if I simply enter the path to the executable at a command line prompt. So, at a command prompt,

"C:\Program Files\Microsoft Office\Root\Office16\Excel.exe" - will work perfectly, but
C:\Progra~1\Micros~2\Root\Office16\Excel.exe - will fail with the same error.
3. This behaviour is repeated with every executable on every path I have tried.

4. The error box is headed with the name of the .exe, so it IS finding the executable on the path, it just won't launch it.

5. If I type the ~ notation path in to the address bar it navigates to the folder without difficulty.

So, it is nothing to do with:
- being in a batch file
- the syntax of 'start'
- any particular executable

- the validity of the path.

It just seems that, at least when launching an application, ~ notation pathnames do not work with our Windows 10 image by default.

Is there something we need to change so that they will?

While I am grateful to anyone who takes time with this, I would respectfully ask that you only reply if you _know the answer_, and not with generic troubleshooting routines, because unless you have something truly new, I likely went through it along the path to the workaround I already have (check the path, repair MS Office, run updates, try another machine etc etc).

Continue reading...
 
Back
Top Bottom