Click here to Skip to main content
15,907,492 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

i am using CreateProcessAsUser to launch the Exe. but if try to launch Bat file it failed.

i am using the ImpersonateLoggedOnUser() API in that function.

How to launch the Bat file with Impersonate level.
Posted
Comments
Richard MacCutchan 26-Oct-12 7:54am    
"it failed" does not give us enough information to help you. Please edit your question and show the code that fails and the error messages or status codes that you receive.

1 solution

When you launch a .bat file, you actually launch the command shell, through file type association (like launching a browser by doing CreateProcessAsUser with a .html file).

Have you tried launching the command shell, with the Bat file as a parameter?
 
Share this answer
 

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