[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Restart webserver

Posted on 2009-04-17
Medium Priority
Last Modified: 2013-12-05
I need to be able to restart the webserver on my WinCE 5.0 device programmatically. I know it can be done but I have not found any articles laying it out. This probably works very similar to the WinXP or WinXP Embedded webserver. Any suggestions?
Question by:dbthompson
LVL 86

Expert Comment

ID: 24170140
>>I need to be able to restart the webserver on my WinCE 5.0 device

Take a look at http://www.codeproject.com/KB/system/serviceinstaller.aspx ("Restarting the web server from your program"). The APIs introduced in this article also exist on CE, so that should get you going.

Accepted Solution

dbthompson earned 0 total points
ID: 24171329
Thank you for the link. I have seen that page in CodeProject but it looked more involved than what I wanted to do so I decided to keep looking. Maybe I'm just stubborn. But ultimately I wound up hunting through the Windows folder of my CE device and noticed that there was an executable called "services". I started playing with it and sure enough I was able to figure out how to start and stop and refresh any windows service I wanted to. I have had a look on MSDN for information on Services and it ranged from scant to misleading. So for the sake of posterity I am posting the call to CreateProcess() has worked to restart a WinCE 5.0 Webserver inside my application. This is likely to work for many other services but I have not tested them.

CString ServicesExe = "\\Windows\\services.exe";
CString Arguments = "refresh HTP0:";

BOOL bSuccess = CreateProcess(ServicesExe, Arguments, NULL, NULL, NULL, 0, NULL, NULL, NULL, &ProcInfo);

Thanks again for the help.

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
Know the reasons and solutions to move/import EDB to New Exchange Server. Also, find out how to recover an Exchange .edb file and to restore the file back.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question