Click here to Skip to main content
15,911,848 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am creating windowsservice and using C#.I want open cmd/.exe file from windows service.My operating system is windows8.Does it possible from windows service?or any alternative for that.I want want open cmd/exe after some interval that's why I choosed windows service.
Posted
Comments
Mehdi Gholam 3-Dec-15 1:27am    
cmd to do what?
Sergey Alexandrovich Kryukov 3-Dec-15 1:39am    
It makes no sense at all. CMD.exe this is a pure user interface, you never need to start it from any other process. And especially from a service application. Just forget it. Better tell us what you really need to achieve, perhaps them we help you.
—SA

Provided your application has no window, or other user interface at all then you should be able to do it - an app which just stores values in a a DB for example and shuts would be f
There are (or were, I haven't tried) hacky methods to do it though: Subverting Vista UAC in Both 32 and 64 bit Architectures[^] but if it works in win 7 / 8 / 10, then don't expect it to remain working! :laugh:
 
Share this answer
 
v2
Comments
Member 11589429 3-Dec-15 2:24am    
If I want to create first application and then schedule that application?Which application shall I prefer?
F-ES Sitecore 3-Dec-15 4:17am    
Use the Windows Scheduler. A service probably won't have access to the user's desktop in order to show user interfaces.
C#
Logger.SetLogWriter(new LogWriterFactory().Create(), true);

                Console.WriteLine("Started batch job");
 
Share this answer
 
v3

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