Shutdown.exe won't run

S

steve

I've successfully created a simple C# Windows Application as a custom shell
for XPe.
I want to shutdown the machine by running shutdown.exe from my app. When I
execute shutdown.exe from the app, a black dos screen flickers in the
background for a split second, just long enough so I can't see what it says,
and nothing happens. I tried looking in the application event log
afterwards and it says the application log is corrupted. I know the script
I'm running in my app to execute the shutdown.exe program works because I
tried executing Internet Explorer and that worked fine. I've added the
component that puts shutdown.exe in the Windows\System32\ directory to the
XPe image. Can't figure out what the problem is.

Steve
 
S

Slobodan Brcin

If you saw something then it was a help that tell you how to use
shutdown.exe

You need to run it with arguments like: shutdown.exe -f

Also read more about API function.
ExitWindowsEx

Regards,
Slobodan
 
S

steve

I didn't specifiy in my original post but I was running shutdown.exe with
arguments -f -s so it wasn't the help screen.
I'm guessing it has more to do with permissions. Most recently I ran it
with arguments -i -s -t 10 which gives a gui interface. When Shutdown or
Restart was selected in the combo box, the OK button to procede with the
shutdown, was greyed out. When Log off was selected, the OK button was no
longer greyed out.

Also, I'm running with the MinLogon component rather than the Windows Logon
(Standard).

Steve
 
K

KM

steve,

XP version of shutdown.exe (not W2K version) will throw a permission error
on Minlogon image.
You may want to use XPePM.exe app instead - "Power Management Application"
component under "Software:System:System Services:Base" category. Also check
"\Program files\Windows Embedded\VALUEADDD\MSFT\XPEPM" directory, you can
statically link to the XPePE.dll from your custom shell app and call its
XPE_Shutdown API (may be the best way for you since you won't see any UI you
don't need).

KM


s> I didn't specifiy in my original post but I was running shutdown.exe
s> with arguments -f -s so it wasn't the help screen.
s> I'm guessing it has more to do with permissions. Most recently I ran
s> it with arguments -i -s -t 10 which gives a gui interface. When
s> Shutdown or
s> Restart was selected in the combo box, the OK button to procede with
s> the shutdown, was greyed out. When Log off was selected, the OK
s> button was no longer greyed out.

s> Also, I'm running with the MinLogon component rather than the Windows
s> Logon (Standard).

s> Steve







With best regards, KM. E-mail: (e-mail address removed)
 
S

steve

Found a solution.
I opened a command window from my custom shell and ran shutdown -s. This is
the message I got.
The operation completed successfully.
A required privilege is not held by the client.

So I created a new image and added the Power Management Application
Component. With my new image I ran xpepm.exe -Shutdown
This worked fine.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top