Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi everyone!

I used that command to start a program, but show me error 0xc0000142. This:
Process.Start(C:\Users\Administrator\Desktop\file.exe)


Please help me to fix it idk what command should i use. I can open that prog normally but with that proccess.start i cant.
Also this command works on 99.9% of my programs but on one no.

Please help me to find a solution!
Thank you

What I have tried:

Tried to find a solution on internet and i didnt find it.
Posted
Updated 29-Jul-21 21:39pm
Comments
Richard MacCutchan 31-Jul-21 4:10am    
Look at what you have in the parentheses. Do you notice some control characters missing?

Quote:
Tried to find a solution on internet and i didnt find it.

I guess you did not think to check the documentation: Process.Start Method (System.Diagnostics) | Microsoft Docs[^]
 
Share this answer
 
v2
That code won't even compile: Process.Start takes a string, not a (to C#) odd sequence of characters.
Try:
C#
Process.Start(@"C:\Users\Administrator\Desktop\file.exe");

Your error may be coming from a different version of your code given that this version will not compile.

Error 0xc0000142 is "the application failed to start" and may be related to application word size: if your app is 32 bit you may have problems starting a 64 bit app, and vice versa.
 
Share this answer
 
Comments
ionMEMBER 29-Jul-21 17:23pm    
Thanks for ur answer. Idk, ive a program that can autostart him without error and maybe is from command but i dont use it cus haven't all things that i want.
Process.Start(C:\Users\Administrator\Desktop\file.exe) was vb.net but i tagged some languages programming because is the same problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900