How do I get my VB app to reboot XPE?

  • Thread starter Thread starter Michael Jones
  • Start date Start date
M

Michael Jones

I have tried everything. This includes: running "SHUTDOWN.EXE /x",
and running "c:\windows\fba\FBA.EXE /XX", and calling ExitWindows(),
and using the XPEPM.DLL's functionality. None of them works. I even
switched to Windows Logon, from MinLogon, (which I preferred), just so
that I could auto-logon as Administrator, to see if that would work.

Nothing.

I am capturing from 32 cameras at once, and sometimes the capture
software gets "tired".

All I want to do is reboot the machine if it gets all screwed-up. I
have a service running (that I wrote) that can stop any service on my
machine at will, which works fine.

As a last resort, is there some service that, if stopped, will cause
XPE to restart?

Thanks for any help.

Michael Alan Jones
 
Michael Jones schrieb/wrote:
I have tried everything. This includes: running "SHUTDOWN.EXE /x",
and running "c:\windows\fba\FBA.EXE /XX", and calling ExitWindows(),
and using the XPEPM.DLL's functionality. None of them works.

What I haven't understood yet: Is your problem specific to XPE, or do you
have the same problem when you try under XP Professional?

In the first case, the following might help: ExitWindows does not restart
Windows, it logs off the current user. Use ExitWindowsEx, but remember to
obtain the SE_SHUTDOWN_NAME privilege first. You can find an example for
VBA in KB article 176695: "PRB: ExitWindowsEx API Does Not Reboot Windows
NT"
 
Eberhard Schefold schrieb/wrote:
Michael Jones schrieb/wrote:
I have tried everything. This includes: running "SHUTDOWN.EXE /x",
and running "c:\windows\fba\FBA.EXE /XX", and calling ExitWindows(),
and using the XPEPM.DLL's functionality. None of them works.

What I haven't understood yet: Is your problem specific to XPE, or do
you have the same problem when you try under XP Professional?

In the first case, the following might help: [...]

.... "in the second case", I mean (same problem with XP Prof)
 
Michael,
What do you think "SHUTDOWN.EXE /x" does?

I have an XPE app (we use WinLogin) and we shell out to shutdown.exe to
restart/shutdown the system. We use:
shutdown -r
or
shutdown -s

And it works for us. If you don't have a "-r" or "-s" then shutdown doesn't
do anything.

We found that the API calls that work under XP Pro and Home don't work under
XPE.

Scott
 
Eberhard Schefold said:
What I haven't understood yet: Is your problem specific to XPE, or do you
have the same problem when you try under XP Professional?

In the first case, the following might help: ExitWindows does not restart
Windows, it logs off the current user. Use ExitWindowsEx, but remember to
obtain the SE_SHUTDOWN_NAME privilege first. You can find an example for
VBA in KB article 176695: "PRB: ExitWindowsEx API Does Not Reboot Windows
NT"
---------------------------------------
I don't have any problems with XP Professional - I can do anything I
want, including shutdown or reboot. My difficulties are with XPE (XP
Embedded).

Michael
 
Michael Jones schrieb/wrote:
I don't have any problems with XP Professional - I can do anything I
want, including shutdown or reboot. My difficulties are with XPE (XP
Embedded).

I really have difficulties to imagine that you are able to reboot an XP
Professional with Win32's ExitWindows.

But never mind. Sorry I wasn't of any help.
 
Scott Kelly said:
Michael,
What do you think "SHUTDOWN.EXE /x" does?

I have an XPE app (we use WinLogin) and we shell out to shutdown.exe to
restart/shutdown the system. We use:
shutdown -r
or
shutdown -s
-------------------------------------------------
I am sorry, I didn't mean it literally like that, I meant
"SHUTDOWN.EXE" and a command line parameter. I guess I should have
typed the command verbatim.

I found mention of the shutdown/reboot functions XPEPM.DLL (on the
cd), using shutdown -r and shutdown -s, using c:\windows\fba>fba
-shutdown and c:\windows\fba>fba -reboot, and ExitWindowsEx(), all on
this newsgroup a week ago.

I tried them all to no avail.

I guess really all I need is to be able to shell an EXE. If I could do
that, then I could run shutdown.exe, and I would be done.

I tried:
lResult = Shell("c:\windows\system32\shutdown.exe -r") and it doesn't
work.

I also tried the same command line with WinExec(), to no avail.


Oh, yeah, and I verified that shutdown.exe is in the build, in that
location.

Michael Alan Jones
 
Michael,
I don't have any problems with XP Professional - I can do anything I
want, including shutdown or reboot. My difficulties are with XPE (XP
Embedded).

You should be able to restart your device even from minlogon without
trouble.
If you are sure that you are doing everything correctly, then last resort to
you is WDT.

If you have hardware WDT is will make hardware reset of your device after
guarded process is terminated.

Can you describe your chipset, motherboard, or anything. Someone might have
same issue with hardware you use.

I am capturing from 32 cameras at once, and sometimes the capture
software gets "tired".

Try to make build without drivers and services for video grabber card. Maybe
it is denying restart requests.


Best regards,
Slobodan
 
Have you tried to include a standard shell (like Command Prompt or
Explorer)?

From Command Prompt you may want to test "shutdown.exe [/switches]". It
worked for me here with minlogon and winlogon builds.

Also, from you VB shell app, try to load XPEPM library and call
XPE_ReStart/XPE_Shutdown and see how it works.

KM


MJ> -------------------------------------------------
MJ> I am sorry, I didn't mean it literally like that, I meant
MJ> "SHUTDOWN.EXE" and a command line parameter. I guess I should have
MJ> typed the command verbatim.

MJ> I found mention of the shutdown/reboot functions XPEPM.DLL (on the
MJ> cd), using shutdown -r and shutdown -s, using c:\windows\fba>fba
MJ> -shutdown and c:\windows\fba>fba -reboot, and ExitWindowsEx(), all
MJ> on this newsgroup a week ago.

MJ> I tried them all to no avail.

MJ> I guess really all I need is to be able to shell an EXE. If I could
MJ> do that, then I could run shutdown.exe, and I would be done.

MJ> I tried:
MJ> lResult = Shell("c:\windows\system32\shutdown.exe -r") and it
MJ> doesn't work.

MJ> I also tried the same command line with WinExec(), to no avail.


MJ> Oh, yeah, and I verified that shutdown.exe is in the build, in that
MJ> location.

MJ> Michael Alan Jones
 
Back
Top