forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


AbortSystemShutdown VS. shutdown.exe -a

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Help for VDS 5 & Up
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Aug 28, 2003 9:49 pm    Post subject: AbortSystemShutdown VS. shutdown.exe -a Reply with quote

Hi,

Can someone explain the differences between AbortSystemShutdown
and shutdown.exe -a?

I think they might do the same thing but the API didn't work for me
when I tried it, I don't think, unless I was doing something wrong. Confused

Thanks for any pointers. Very Happy

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Aug 29, 2003 10:11 am    Post subject: Reply with quote

not sure if you already know this or not...shutdown.exe is a xp program that users can use to automate a shutdown...i found lots of information on that little utility by doing a search with google using shutdown.exe as the search term

don't know anything about the api call

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Aug 29, 2003 1:27 pm    Post subject: Reply with quote

Yup I'm using Win XP Professional. Here's the documentation about
using the -a parameter:

Code:
-a                      Abort a system shutdown


When the system is not shutting down and it is used, it returns the
following:

Code:
C:\>shutdown -a
Unable to abort the system shutdown because no shutdown was in progress.

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Aug 29, 2003 2:19 pm    Post subject: Reply with quote

For an app to shutdown the system or stop it the calling process must have the SE_SHUTDOWN_NAME privilege else the command fails. This is for security reasons and is very strict on NT based systems.
So you should get the current privileges of your VDS app and if it does not have proper privilge you should give it by using AdjustTokenPrivileges
API. The path is *quite complex* and involves defining an array within a structure. Somehow I lost interest in that one reason being time constraints.
You can have a look for details:
http://developer.vdsworld.com/viewtopic.php?t=109
FF
I will look up for a working VB code on my HDD if you know VB
Regards

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Aug 29, 2003 2:57 pm    Post subject: Reply with quote

Thanks CodeScript for your response. I don't need any code, just
was wondering what the difference was. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Fri Aug 29, 2003 6:25 pm    Post subject: Reply with quote

FF,
There is no difference between the -a switch and AbortSystemShutdown the utility uses the same API. I have built a DLL for this but I never released it because I wanted a better way to perform the Remote shutdown. I have found shell script that can do this just I have not had time to translate it to a DLL for us to use...

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Help for VDS 5 & Up All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group