473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

can web service start exe file

Dear

i have create a windows service. I want to execute hello.exe from windwos service. i try

Expand|Select|Wrap|Line Numbers
  1.             ManagementClass processClass = new ManagementClass("Win32_Process");
  2.             //Get an input parameters object for this method
  3.             ManagementBaseObject inParams = processClass.GetMethodParameters("Create");
  4.             //Fill in input parameter values
  5.             inParams["CommandLine"] = "calc.exe";
  6.             //Execute the method
  7.             ManagementBaseObject outParams = processClass.InvokeMethod("Create", inParams, null);
  8.  
  9. or
  10.  
  11.             ProcessStartInfo startinfo = new ProcessStartInfo();
  12.             startinfo.CreateNoWindow = false;
  13.             startinfo.UseShellExecute = false;
  14.             startinfo.RedirectStandardError = true;
  15.             startinfo.RedirectStandardInput = true;
  16.             startinfo.FileName = "C:/abc.exe";
  17.             startinfo.WorkingDirectory = "C:/";
  18.             startinfo.WindowStyle = ProcessWindowStyle.Normal;
its both are run hello.exe find. its can't show any form display. but i check on taskbar hello.exe run under System User Name.

Please help me, i how to display hello.exe form from windows service.

Thank in advance.

Bhim Prakash Singh
Oct 25 '10 #1
0 996

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Troy Murphy | last post by:
I seem to remember using a walkthru in the early beta that demonstrated how to create a Windows Service that would monitor events in a folder. Can someone please direct me to an example of doing...
12
by: JSheble | last post by:
I've written a Windows Service using C#, but I cannot seem to figure out how to cancel or prevent the service from starting under certain conditions. For example, in the OnStart I read in some...
3
by: Mike Frank | last post by:
What is the correct way to abort a service start in the OnStart method if things were detected which will not let the service run properly? I could simply throw an exception and the serice will...
4
by: Pippo | last post by:
My environment... VS .NET 2003 One solution 3 Project (1 Windows service - 1 Windows application - 1 Installshield basic msi) I know that there's not possible create a service with gui. In...
2
by: Al | last post by:
Although it is not recommended to use the Start Parameters for a service, I am wondering why i get an IndexOutOfRange error when i try to access the args in the OnStart method. I place say,...
17
by: UJ | last post by:
Is there any way for a windows service to start a windows program ? I have a service that will need to restart a windows app if it needs to. TIA - Jeff.
4
by: PeterW | last post by:
I have a Windows service that needs to get some values from a config file. I place the config file for the service in the System32 directory. I do not get the values using the usual...
2
by: Scewbedew | last post by:
Being a newbie on C# managed services, I've probably done something horribly wrong here... The intent is to create a windows service that runs under the SYSTEM account. I have created a service...
1
by: Saish | last post by:
Hi All I am working with web services in .NET. Environment : Web Service/IIS5.1/ASP.NET 2.0 / VB.NET To Consume the Web Service Source file I have followed the below steps. step 1: wsdl.exe...
14
by: Peter | last post by:
..NET 3.5 I have a Windows Service application and it does remoting, but when a client incounters an error the client get the following error message "Server encountered an internal error....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.