473,664 Members | 3,028 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 SetCurrentProce ssPrivileges with SE_PRIVILEGE_EN ABLED flag.

2) Doing a shutdown by,
::InitiateSyste mShutdown(
(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 InitiateSystemS hutdown 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 1572
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
1943
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 2.8 Trying to run this ASP.NET app. It has worked before. No code has changed so I'm convinced the problem is with some server settings.
4
2287
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 COM object, and 3. restart IIS. Is there any way that I can move the newest COM object DLLs to the WINNT/SYSTEM32 directory, without having to stop and restart IIS?
2
4578
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 Here's the scenario: 1. .NET Windows Client on a remote machine makes a web service call to update tables on a Web Server running SQL Server 2000. 2. The Update is updating about 1000 - 3000 records doing simple update statements like "Update...
7
3206
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 think the username can be read with user.identity.name.
10
1902
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 computer that hosts the service, I get a Null Reference Exception when I try to connect to the database (I have set the service to start automatically). Any ideas why this is happening? Thanks in advance. Ajay Mirmira
5
3624
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 New System.Diagnostics.Process 'p.Start(MDEPDirStr & "macrun.exe", sPPTOut) p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE") 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
1
1954
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
1416
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. The process to restart my page takes between 4 to over 6 hours! My hoster told me that I have about 200,000 files in a directory folder and when the site restarts, windows loops trough each file to set security properties (NTFS). The whole thing...
9
3469
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, but it is unable to start automatically at system restart and following errors are displayed in the Event Logs. 1 - Timeout (30000 milliseconds) waiting for the (Service Name) service to connect. 2 - The (Service Name) service failed to start...
0
8437
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8348
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8861
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8778
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7375
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6187
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5660
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1759
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.