shutdown in startup script

  • Thread starter Thread starter Gerhard Schaden
  • Start date Start date
G

Gerhard Schaden

i tried to shutdown the device with the command
shutdown -r -t 0 in startup script
but it looks like that i don´t have the capabilites to to
so.
is there another way to reboot the machine. i also read
from a updated version of shutdown.exe. which i can get on
request from MS :)
perhaps somebody can send this new version by email.
 
You could use the power management application, xpepm,
which is what I have in my image. You can xpepm -shutdown
or xpepm -restart
 
Here is the way I would do this. Try this command:

shutdown -r -f -t 05

here is the command line syntax which I'm sure you looked
at, but just in case...

Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m
\\computername] [-t xx] [-c "comment"] [-d up
:xx:yy]

No args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without warning
-d [p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive
integer less than 256)
yy is the minor reason code (positive
integer less than 65536)


Robert
 
FBA.exe can be used to shutdown or reboot the system.

c:\windows\fba>fba -shutdown
c:\windows\fba>fba -reboot

Regards,

Sean Liming
www.a7eng.com
Author: Windows XP Embedded Advanced and Windows NT Embedded Step-by-Step



Here is the way I would do this. Try this command:

shutdown -r -f -t 05

here is the command line syntax which I'm sure you looked
at, but just in case...

Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m
\\computername] [-t xx] [-c "comment"] [-d up
:xx:yy]

No args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without warning
-d [p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive
integer less than 256)
yy is the minor reason code (positive
integer less than 65536)


Robert
 
If you a have windows script in your XPe build then you could using a
vbscript to shutdown the system, let me know if you want more information.



Wayne Taylor

i tried to shutdown the device with the command
shutdown -r -t 0 in startup script
but it looks like that i don´t have the capabilites to to
so.
is there another way to reboot the machine. i also read
from a updated version of shutdown.exe. which i can get on
request from MS :)
perhaps somebody can send this new version by email.
 
Gerhard,
This script will shutdown the computer
---
Set colOperatingSystems =
GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from
Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(1)
Next
----

This one will reboot the machibe
---
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer &
"\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Reboot()
Next

------

Regards,

Sean Gahan



i tried to shutdown the device with the command
shutdown -r -t 0 in startup script
but it looks like that i don´t have the capabilites to to
so.
is there another way to reboot the machine. i also read
from a updated version of shutdown.exe. which i can get on
request from MS :)
perhaps somebody can send this new version by email.
 
Back
Top