Hi Michael,

You can also use the api function 'InitiateSystemShutdown(Ex)': 
http://msdn.microsoft.com/library/en-us/sysinfo/base/initiatesystemshutdown.asp
I even think that the shutdown command is based on this api function. I used 
it in the past and it does the trick very well ;-)
Make sure that you read the documentation, because you will need to enable 
privileges, if your remote system doesn't shut down it's probably because of 
the privileges...

Greets,
Nick
----- Original Message ----- 
From: "Glenn B. Lawler" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, April 04, 2005 11:33 PM
Subject: RE: [delphi-en] Re: Restart a remote computer


>
>> Eeeerm... I think that the aim is to restart computer A from computer B. 
>> If
>> so, an app will be needed running on A and waiting for connections (from 
>> B).
>> Upon connection, it will execute SHUTDOWN or ExitWindowsEx, or whatever. 
>> :)
>>
>> So, there will be 2 apps needed: a "server" (listening, restarting) and 
>> client
>> (making the "deadly" connection).
>
> Mike,
>
> You are right about the SHUTDOWN command included with the
> workstation versions of Windows; however, the same command is available
> on server versions of Windows with the following usage:
> ---------------------------------------
>
> Usage: SHUTDOWN [/?] [\\Computer] [/L] [/A] [/R] [/T:xx] ["Msg"] [/Y] [/C]
>
> /?              Shows this screen.
> \\Computer      Specifies a remote computer to shutdown.
> /L              Specifies a local shutdown.
> /A              Abortes a systemshutdown. This is only possible during the
>                timeout period.If this switch is used, all other are 
> ignored.
> /R              Specifies that the machine should reboot after shutdown.
> /T:xx           Sets the timer for system shutdown in seconds.[20 sec. 
> default]
> "Msg"           Specifies an additional message
> /Y              Answer all following questinons with yes
> /C              Forces running applications to close.
>                ATTENTION: If you use the /C parameter NT ignores the
>                           applications option to save data which may
>                           have changed. You will see no File-Save dialog
>                           box, because NT will force the application to
>                           close. This will result in a loss of all data.
>                           not previously saved !!!
> ---------------------------------------
>
> Notice the \\Computer option which allows operating on a remote computer.
>
> As I said in a previous e-mail, if anyone knows how to do this with the 
> API,
> I am interested. If you want this functionality from your own program, you
> can always run SHUTDOWN from your program.
>
> Glenn Lawler
>
>
>
> -----------------------------------------------------
> Home page: http://groups.yahoo.com/group/delphi-en/
> To unsubscribe: [EMAIL PROTECTED]
> Yahoo! Groups Links
>
>
>
>
>
>
>
> 


-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to