473,508 Members | 2,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to restart a Windows 2003 server system

17 New Member
Hello,
I am using the following code to restart a Windows 2003 server system locally

1) I am setting the appropriate priviledge for the process by calling the SetCurrentProcessPrivileges with SE_PRIVILEGE_ENABLED flag.

2) Doing a shutdown by,
::InitiateSystemShutdown(
(LPTSTR) NULL, // pointer to name of computer to shut down
(LPTSTR) NULL, // pointer to message to display in
(DWORD) 0, // time to display dialog box
(BOOL) TRUE, // force applications closed flag
(BOOL) TRUE // reboot flag
);

However the system does not restart...is there a restriction to use InitiateSystemShutdown locally on a Windows 2003 system?This code was working on a windows 2000 system, so it makes me think that Windows 2003 might have something to do with it...


Any help will be appreciated..

Thanks!
JSha
Jan 23 '08 #1
1 1565
Banfa
9,065 Recognized Expert Moderator Expert
However the system does not restart...
You mean that it does not shut down or that it shuts down but does not restart?

What error codes a re you getting from the function calls?
Feb 13 '08 #2

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

Similar topics

0
1927
by: Scotter | last post by:
Hi - I posted this message in the microsoft.public.inetserver.iis group, as well. I hope someone can help. My client is frantic. Platform: Windows 2003 Server Enterprise Edition, latest MDAC...
4
2277
by: Wendy Elizabeth | last post by:
I am working with 2 com object dlls that are located in WINNT/SYSTEM32 directory. When I need to make changes to the DLLs, I need to do the following: 1. stop IIS 2. unregister and register the 2...
2
4560
by: Chris Langston | last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server that is experiencing strange shutdown problems. We are using ASP.NET v1.1 and our application is written in VB.NET ...
7
3193
by: lvpaul | last post by:
Hallo ! I am using IIS-Windows-Authentication in my intranet (web.config <authentication mode="Windows" /> <identity impersonate="true" /> How can I get the users (client) IP-Address ? I...
10
1887
by: amirmira | last post by:
I have a Windows Service developed in VB.NET that attempts to connect to a database as soon as the service starts. I have no problem when I start the service manually - but when I restart the...
5
3612
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
1
1944
by: DataSprings | last post by:
Hi. I am wondering if its possible to restart IIS or my web server simply from an IIS page? Not sure what code I would need and maybe impersonation? Any thoughts or ideas anyone? -Chad
3
1412
by: wwwmike | last post by:
Once a while my server is showing my the "Service Unavailable" page when IIS6 kills itself. My shared hosting at allows me to click on an "Update Website" button which restarts the whole site. ...
9
3462
by: Yasir Zaheer | last post by:
I have made a windows service which is configured to start automatically at the system startup under the USER account type. The service is working perfectly fine when I try to start it manually,...
0
7326
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
7383
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7498
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...
1
5053
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...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.