Help - Search - Members - Calendar
Full Version: Shutdowngui For Windows/pe
The CD Forum > Bart's PE Builder > Plugins
Pages: 1, 2
Joshua
Hi, everyone.
after using the nice xpe-pluging from sherpya (http://www.911cd.net/forums/index.php?showtopic=2503) for a long time,
i still missing some thing. that was a nice GUI-Shutdown.
there a some versions here in the forum, but all are in one language.
i also use the very good PE Network Configurator from TheTruth(http://www.geocities.com/pierremounir/) but also only in english.
OK, i have no problem do understand, but i notice that are a lot people
from different Countries in this forum.
there for, i ask myself, why not make the plugins or GUI for every Language?
My first version is ready!
A plugin for shutdown, in english!!!
but you can modify by eding (Shutdown.ini) in your local language !!!

what do you think about this ???

Joshua

P.S. you can download here, http://www.drowaelder.de/downloads/ShutdownGUI.zip
sherpya
really It's not a bad idea, I would prefere windows "native" shutdown/restart, but I think this cannot be done yet, since if my opinion is right, WinLogon should call all the stuff (logon+explorer) and this key should be blank:
CODE
0x1,"Setup","CmdLine","Explorer.exe"

But right now removing this will cause winpe reboot
Forbes
Good work Joshua.

I have a question I was wondering if you could help me with though.

I use Sherpa's XPE explorer as my shell, and I have found that I when I scripted the use of peshuteject to eject and shut down it wouldn't complete. Obviously the cd was ejecting and because the shell was running from the CD it couldn't run the shut down command - it would just lock up.

I have tried your exe with peshuteject and it works! HOW? Could you tell me how I can script this? Your app is great but I just need to call it from a cmd line, not from your GUI. Sorry if this seems a stupid question but I have have tried running from different batch files and nothing. I'm not a programmer.

Any help greatfully received.

Forbes.
Seam
@Joshua

It's Cool! laugh.gif

Thanks for your great work!

BTW,I have a question,I also used xpe,the reg files you already refer like this:

;0x1,"ControlSet001\Control\Nls\Language","InstallLanguage","0410"
; if you want German
0x1,"ControlSet001\Control\Nls\Language","InstallLanguage","0407"
0x1,"ControlSet001\Control\Nls\Language","Default","0407"

; if you want English
0x1,"ControlSet001\Control\Nls\Language","InstallLanguage","0409"
0x1,"ControlSet001\Control\Nls\Language","Default","0409"

What about Chinese??
sherpya
I'm not sure to add these keys, I've added all nls stuff in last release, but before no one signaled the problem. Anyway
CODE
  00000405=cz      00000414=no      0000080C=be
  00000406=dk      00000415=pl      00000813=be
  00000407=gr      00000416=br      00000816=po
  00000409=us      00000419=ru      00000C0C=cf
  0000040A=sp      0000041A=yu      00001009=us
  0000040B=su      0000041B=sl      0000100C=sf
  0000040C=fr      0000041D=sv      00010409=dv
  0000040E=hu      00000807=sg      0001040A=sp
  0000040F=us      00000809=uk      00010C0C=cf
  00000410=it      0000080A=la      00020409=us


I think is not so trivial to make xpe work with chinese since there are a lot of additional stuff to add (like IME etc), and I don't have xp chinese nor understand chinese smile.gif
Joshua
QUOTE (Forbes @ Nov 25 2003, 01:44 AM)
Good work Joshua.

I have a question I was wondering if you could help me with though.

I use Sherpa's XPE explorer as my shell, and I have found that I when I scripted the use of peshuteject to eject and shut down it wouldn't complete.  Obviously the cd was ejecting and because the shell was running from the CD it couldn't run the shut down command - it would just lock up.

I have tried your exe with peshuteject and it works!  HOW?  Could you tell me how I can script this?  Your app is great but I just need to call it from a cmd line, not from your GUI.  Sorry if this seems a stupid question but I have have tried running from different batch files and nothing.  I'm not a programmer.

Any help greatfully received.

@Forbes
Please give me an example of your Batch file.
Will look to it in the evening. (now i am working)

@Seam
i think sherpya are right.

Joshua
Seam
@sherpya

; if you want Chinese
0x1,"ControlSet001\Control\Nls\Language","InstallLanguage","0804"
0x1,"ControlSet001\Control\Nls\Language","Default","0804"

wink.gif
Joshua
QUOTE (Joshua @ Nov 24 2003, 11:20 PM)
Hi, everyone.
after using the nice xpe-pluging from sherpya (http://www.911cd.net/forums/index.php?showtopic=2503) for a long time,
i still missing some thing. that was a nice GUI-Shutdown.
there a some versions here in the forum, but all are in one language.
i also use the very good PE Network Configurator from TheTruth(http://www.geocities.com/pierremounir/) but also only in english.
OK, i have no problem do understand, but i notice that are a lot people
from different Countries in this forum.
there for, i ask myself, why not make the plugins or GUI for every Language?
My first version is ready!
A plugin for shutdown, in english!!!
but you can modify by eding (Shutdown.ini) in your local language  !!!

what do you think about this ???

Joshua

P.S. you can download here, http://www.drowaelder.de/downloads/ShutdownGUI.zip

ShutdownGUI plugin V 1.1 is ready for download.
Download ShutdownGUI V1.1

Joshua

Rickj
@Joshua

Works Great!!

Thanks
Xephion
Looks and works great!

One wish:
On the Shutdown/Eject command - can we make the GUI call a batch file that will wait a specified time before shutdown - say 15 seconds? That would give enough time to get the CD out and close the drawer. I propose using a batch similar to this:

CODE
@ECHO OFF
%ramdrive%
peshuteject /eject:%systemdrive%
sleep 15
peshuteject /shutdown
:END


The sleep exec is freeware and can be downloaded here.

I assume that peshuteject will have to load from RAMDisk for this to work. Can we incorporate this?
Rootman
Su-poib! smile.gif
Joshua
QUOTE (Xephion @ Nov 26 2003, 09:50 PM)
Looks and works great!

One wish:
On the Shutdown/Eject command - can we make the GUI call a batch file that will wait a specified time before shutdown - say 15 seconds?  That would give enough time to get the CD out and close the drawer.  I propose using a batch similar to this:

CODE
@ECHO OFF
%ramdrive%
peshuteject /eject:%systemdrive%
sleep 15
peshuteject /shutdown
:END


The sleep exec is freeware and can be downloaded here.

I assume that peshuteject will have to load from RAMDisk for this to work.  Can we incorporate this?

@Xephion
what you want is not so easy at this moment, because i use
the peshuteject.exe from dicht.
i am working on a stand alone version that also test for
running processes. But i have not so much time for programming
if i want! first business then hobby. even though my business is also my hobby !!!

Joshua
Joshua
QUOTE (Xephion @ Nov 26 2003, 09:50 PM)
Looks and works great!

One wish:
On the Shutdown/Eject command - can we make the GUI call a batch file that will wait a specified time before shutdown - say 15 seconds?  That would give enough time to get the CD out and close the drawer.  I propose using a batch similar to this:

CODE
@ECHO OFF
%ramdrive%
peshuteject /eject:%systemdrive%
sleep 15
peshuteject /shutdown
:END


The sleep exec is freeware and can be downloaded here.

I assume that peshuteject will have to load from RAMDisk for this to work.  Can we incorporate this?


@Xephion
V 1.2 is ready.
now you can use at cmdline, and it wait until you have remove your cd.
Download ShutdownGUI V1.2

Joshua
Xephion
@Joshua
Tested and works great! biggrin.gif Thanks for the update!
FeelGood
hi joshua

its a great work

but i change the string in the xml file

<MENU ID="Startmenu">

because i this it better .


and my cd will not be eject if i press restart and eject
FeelGood
hi joshua

its a great work

but i change the string in the xml file

<MENU ID="Startmenu">

because i think this it better .


and my cd will not be eject if i press restart and eject
Joshua
QUOTE (FeelGood @ Nov 28 2003, 09:00 AM)
but i change the string in the xml file
<MENU ID="Startmenu">
because i this it better .

@FeelGood
you are right.
will fix that in next version.

Joshua
betaluva
way cool, thanks smile.gif
ArtieM
Does ShutdownGUI work with BartsPE ? I cannot seem to get it to go and I've not seen any reference to BartsPE in this thread. Any help will be appreciated. Thanks...
ArtieM
themaxdj
sherpya, i tried your last change and still recieved this error after shutdown.
this is the windows protection error i got after trying it.

stop: 0x0000007a
oxe12104do
oxc0000098
0x0184b860
win32k.sys address bf924887
base at bf800000
date stamp 3d6de5e5

i replied to you after trying it you must not have seen it
solara
Taken from the spysweeper plugin:

QUOTE
<MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetProgramDrive()\Programs\ShutdownGUI\ShutdownGUI.cmd))" CMD="RUN" FUNC="@exec(cmd.exe /c @GetProgramDrive()\Programs\ShutdownGUI\ShutdownGUI.cmd @GetEnvVar('ramdrv')\ShutdownGUI,0)">Shutdown Windows</MITEM>


This seems to launch the cmd file without opening a separate window beforehand. Granted the default way of launching the cmd only shows a blackscreen window very briefly...but it's a little of an eyesore. So the above should launch shutdowngui.cmd without any obvious Command window being opened.

Btw, any way to modify peshuteject so that if it's run, it will automatically copy itself to the ramdrive, and then get executed? And would it be possible for your version of shutdowngui.exe to be viewable on top of the PELock screen?

If those two options could be implemented, then the option to Shutdown/Eject would then be accessible from the PELock screen as well (currently the shutdowngui.exe is hidden below the PELock screen. And even if it's visible, selecting Shutdown/Eject would not work since it wasn't launched by the cmd, and there is no copy of itself on the ramdrive.)
user81
H,i iam new to this forum.

I came to know about PE builder recently and built one successfully after a lot of trial and errors.

@Joshua

I downloaded and used your ShutdownGUI V1.2 and used it. My problem is it is ejecting the wrong drive.
i.e.

I had 2 drives:
LG CD writer connected as Secondary master and
Asus CDROM connected as Secondary slave.

I use my cd-writer to boot the PEcd.
whenever i press the button Shutdown/Eject, it ejects the Asus drive tray instead of my LG cd-writer tray.

IS this a bug or do i need to make any adjustments to any of the files?

my PE builder version: 3.0.32
XPE version: 1.0.2
bpl5000
Hi Joshua,

We have a VB program that maps a drive and launches ghost. When ghost finishes and exits, then the program is suppose to reboot the PC. All works well when the CD is in the drive, but we want to remove the CD so that when we return, the PC is at the sign on screen. The person doing the ghosting would remove the CD and leave the room to ghost another PC. It would make his life so much easier if he did not have to reboot the PC when he re-entered the room. Do you know of anyway to restart the computer without the CD being present?

Thanks!
Joshua
QUOTE (bpl5000 @ Sep 13 2005, 03:38 AM)
We have a VB program that maps a drive and launches ghost.
*


Do you have the Sourcecode from the vb-program?
then it is possible.

Joshua
bpl5000
Yes, we have the source code... we made the VB program. What do I need to add to make the PC reboot when the CD is removed? I've tried "nu2shell -r" and I tried running the ghost reboot program from a network drive, but it only works if the CD is present. Help! sad.gif

Thanks!
Joshua
QUOTE (bpl5000 @ Sep 13 2005, 03:12 PM)
Yes, we have the source code...
*

You have to put the routine to shutdown windows in to your vb program.
it was a special API-call that works under pe.
I am not at my private home pc, there fore i can not post it in this moment. wink.gif
if you need the code, send me a pm with your email-adress, and i send it to you
in the evening.

Joshua
bpl5000
Ok, I sent my email address... hope you got it. Thanks for the help! I really appreciate it!
Joshua
Here the code for all !
CODE
'**************************************
'Windows API/Global Declarations for :
'Turbo Computer Shutdown - Fastest
'**************************************
'Add the following declerations to a module
'.BAS file
'


Public Declare Function RtlAdjustPrivilege& Lib "ntdll" (ByVal Privilege&, ByVal NewValue&, ByVal NewThread&, OldValue&)


Public Declare Function NtShutdownSystem& Lib "ntdll" (ByVal ShutdownAction&)
   Public Const SE_SHUTDOWN_PRIVILEGE& = 19
   Public Const Shutdown& = 0
   Public Const RESTART& = 1
   Public Const POWEROFF& = 2


CODE
'**************************************
' Name: Turbo Computer Shutdown - Fastest
' Description:This is the fastest shutdown
' around, be carefully once you issue
' this command your computer shutdown
' instantly.
'


Sub TurboShutdown()
   RtlAdjustPrivilege SE_SHUTDOWN_PRIVILEGE, 1, 0, 0
   NtShutdownSystem Shutdown 'shutdown
   'NtShutdownSystem restart 'restart
   'NtShutdownSystem poweroff 'poweroff
End Sub


Joshua
bpl5000
Joshua,

That code works great! Thanks so much for the help. You're awesome!

Brian
Joshua
@bpl5000
biggrin.gif

Joshua
bpl5000
Hi Joshua

Sorry to keep bugging you, but I have another problem I cannot figure out so I need help from an expert. I want to put a CD eject statement in my VB program. I tried using mciSendString, but it doesn't work in the PE environment. Is there an API-call that I can do in the BartPE environment?

Thanks
Joshua
@bpl5000
i have send you a test program.
is that what you wan't ?

Joshua
bpl5000
Thanks for the program, but what I would really like is the code that ejects the cd so I can put it into my VB program smile.gif
this-is-me
I need the unlock code myself, I can eject the drive if it us unlocked first.
Joshua
@bpl5000
@this-is-me
i will upload the program with sourcecode (visualbasic) in the evening.

Joshua
twindude
Joshua can we get "eject cd and reboot" added?

using bs explorer
xp sp2
Joshua
QUOTE (twindude @ Sep 20 2005, 08:01 PM)
Joshua can we get "eject cd and reboot" added?
*


if i have some spare time ?! biggrin.gif

Joshua
Joshua
QUOTE (this-is-me @ Sep 18 2005, 08:22 PM)
I need the unlock code myself, I can eject the drive if it us unlocked first.
*


here the sample program with source. wink.gif


http://www.drowaelder.de/winpe/eject/CD-Eject.rar

Joshua
twindude
thanks .......... great job......as well

i just can understand Russian that good ......

Thanks goes out to all Plugins and Tools
Ed_P
I agree. THANK YOU Joshua. smile.gif
bpl5000
Joshua, you rule! That's great code and it works so well. I would like to paste the code that I extracted in case someone else wants to put the CD eject function into their own program. Please note, this is not code for a GUI program... it simple ejects the CD tray. If you want a GUI interface, you need Joshua's code.

CODE
'***Here are things you need to first declare***
  ' // Constants for DeviceSetMedia
   Public Const IOCTL_STORAGE_EJECT_MEDIA As Long = &H2D4808
   Public Const INVALID_HANDLE_VALUE As Long = -1&
   Public Const GENERIC_READ As Long = &H80000000
   Public Const FILE_SHARE_READ As Long = &H1
   Public Const FILE_SHARE_WRITE As Long = &H2
   Public Const OPEN_EXISTING As Long = 3

  ' // Public Functions for DeviceSetMedia
  Public Declare Function CreateFile Lib "kernel32" _
  Alias "CreateFileA" _
 (ByVal lpFileName As String, _
  ByVal dwDesiredAccess As Long, _
  ByVal dwShareMode As Long, _
  lpSecurityAttributes As Any, _
  ByVal dwCreationDisposition As Long, _
  ByVal dwFlagsAndAttributes As Long, _
  ByVal hTemplateFile As Long) As Long
 
  Public Declare Function DeviceIoControl Lib "kernel32" _
 (ByVal hDevice As Long, _
  ByVal dwIoControlCode As Long, _
  lpInBuffer As Any, _
  ByVal nInBufferSize As Long, _
  lpOutBuffer As Any, _
  ByVal nOutBufferSize As Long, _
  lpBytesReturned As Long, _
  lpOverlapped As Any) As Long
 
  Public Declare Function CloseHandle Lib "kernel32" _
  (ByVal hObject As Long) As Long

CODE
'***Here's the function to eject the CD***
Public Function DeviceSetMedia(sDrive As String, ctrlCode As Long) As Boolean
' // Function used to open CD tray
  Dim hDevice As Long
  Dim bytesReturned As Long
  Dim success As Long
 
 'obtain a handle to the device
  hDevice = CreateFile("\\.\" & sDrive, _
                       GENERIC_READ, _
                       FILE_SHARE_READ Or FILE_SHARE_WRITE, _
                       ByVal 0&, _
                       OPEN_EXISTING, _
                       0&, 0&)
  If hDevice <> INVALID_HANDLE_VALUE Then
    'If the operation succeeds,
    'DeviceIoControl returns zero
     success = DeviceIoControl(hDevice, _
                               ctrlCode, _
                               0&, _
                               0&, _
                               ByVal 0&, _
                               0&, _
                               bytesReturned, _
                               ByVal 0&)

  End If
 
  Call CloseHandle(hDevice)
End Function

CODE
'***Here's how to call the function***
sDrive = "D:"
Call DeviceSetMedia(sDrive, IOCTL_STORAGE_EJECT_MEDIA)
'I attempt to open both D and E drive
sDrive = "E:"
Call DeviceSetMedia(sDrive, IOCTL_STORAGE_EJECT_MEDIA)


Thanks again Jushua! I would have been lost without your help. smile.gif
jimshu1
I have tried to use this plugin several times, but with no luck. It starts up a DOS box and executes to the 2nd command line, pauses, and then the DOS window closes.

I have three optical drives, and maybe this is the problem. How would I edit the plugin to specify which optical drive to eject from?

Thanks for any help!
Joshua
QUOTE (jimshu1 @ Oct 12 2005, 10:55 AM)
How would I edit the plugin to specify which optical drive to eject from?
*

this is not possible with this version.
i am working on a new version with more options.
you can also try paragliders shutdown plugin.
http://www.paraglidernc.com/6901.html

Joshua
jimshu1
Thank you Joshua! I'll give them a try.
bpl5000
Hi Joshua,
The code you gave me here to eject the CD worked perfect until I switched from using XP SP1 to XP SP2. Now the eject does not work and I don't even get an error. I switched back to using SP1 and it works fine. Any idea why the cd eject code will not work with SP2?
Thanks!
Joshua
QUOTE (bpl5000 @ Mar 1 2006, 05:20 PM) *
Any idea why the cd eject code will not work with SP2?

i have no idea. sad.gif
i also use sp2, and for me it works. have you test it under vanilla BartPe?
what is your exact configuration? XPE, Reatago, any other shutdown plugins ?

Joshua
Joshua
ShutdownGUI plugin V 2.0 is ready for download.
much smaller.
no more need to copy it to ramdisk.
you can remove your cd before shutdown.
cd drive will be closed automatic after you remove your cd.

Joshua
SLK001
Running a simple, plain vanilla BartPE XP w/SP2 disk, I get the same problem as the last version.

Running the program under basic Bart gives you this error:

CODE
RUN-TIME ERROR '50003':
UNEXPECTED ERROR
Joshua
QUOTE (SLK001 @ May 17 2006, 03:19 PM) *
Running the program under basic Bart gives you this error:
CODE
RUN-TIME ERROR '50003':
UNEXPECTED ERROR

if you don't use a vb-plugin, you have to use this shutdownGUI.inf

QUOTE
; PE Builder v3 plug-in INF file
; by Joshua
; V2.0 - 17.05.2006

[Version]Signature= "$Windows NT$"

[PEBuilder]
Name="Shell: PE-Shutdown-GUI"
Enable=1
Help="Shutdown.htm"

[WinntDirectories]

[SourceDisksFiles]
ShutdownGUI.exe=2,,1
Shutdown.ini=2,,1
msvbvm60.dll=2,,1
asycfilt.dll=2,,1

[Append]
nu2menu.xml, ShutdownGUI_nu2menu.xml


Joshua
SLK001
Thanks Joshua,

Having those dependencies in the system32 folder fixed the problem (I didn't have the asycfilt.dll file).

Also, as a heads-up, ewido anti-malware reports a "Backdoor.Bifrose.d" infection in ShutdownGUI.exe. Neither Norton AV nor Kaspersky AV report any issues. Makes me wonder about ewido's scan technique.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.