[release] PowerOffXP

Hi there -

this is another desklet (using sysstats) I'm working on.

It can shut down/log off/restart/send your computer to sleep on a single click by starting the XP-built-in shutdown.exe!

But don't get to excited, the built-in applicaton isn't too powerful:

If it will really power off your computer or just end with "you can switch off your computer now" depends on your computer itself and its settings as far as I know.

TIP:

-------

I myself don't use the built-in shutdown.exe, I'm using PowerOff 3 - a free program available at

http://users.pandora.be/jbosman/applications.html

which will really power off your beloved one ;O) and has got a lot more options.

THIS SHOULD ALSO WORK ON NON-XP MACHINES!

Like the shutdown.exe it can be controlled by command lines and therefore is easy to integrate in the desklet.

HOW IT WORKS (If you want/have to change settings):

----------------------------

Right click the desklet, press "Configure..." and go to the tab "Controllers". There are 4 shortcut controllers called "Shutdown", "Sleep", "Restart" and "LogOff".

If you want, you can change their settings by marking them and pressing "configure".

They all point to "C:WINDOWSsystem32shutdown.exe".

In the argument field you'll find the extensions telling XP what to do:

-s will shutdown your computer ("Shutdown")

-s -t 300 will shutdown your computer after a delay of 300 seconds ("Sleep") - you can change the time delay to whatever value you like in seconds.

-r will restart your computer ("Restart")

-l is for logging off ("LogOff")

-i opens a shutdown dialog (not the one you normally get with XP)

There are more options available for the XP-built-in application - open a command line (prompt) and type "shutdown /?" for details.

HOW TO USE:

-----------------------

Rename POXP.zip into POXP.aveinst and doubleclick it while AveDesk is running -

That's it: By pressing one of the 4 arrows on the button the program starts. Hovering over them will show you what they do (Used Mouse Move controller).

ISSUES:

-----------

- If you didn't install Windows on C: (it is possible!), you have to change the Path of the 4 shortcut controllers to point to your shutdown.exe...

- If nothing seems to happen, either the Path is wrong or your computer just needs some time to shutdown - there won't be any confirmation dialog or similar that shows you the program started! You can check however by setting one of the arguments to -i. A dialog should show up at once...

- If you don't like the "sunken in" look of the desklet, right click it, choose "Configure..." and go to "Overlays". By marking "Emboss", unckecking the field "Visible" and then marking "Shadow", checking "Visible" you can give it a "hovering over the desktop" look.

- If you wonder about the small buttons that can be seen in the preview when installing - I want to include a skin without the "Mouse Move" controller in future:

I myself have problems with it on older (well, very old) machines. This might be based on having problems with AveDesk at all on these machines...

- If you want to use "PowerOff 3" like me (or a similar program controlled by command lines), all you have to do is to change the path and arguments of the 4 shortcut controllers mentioned above:

"....poweroff.exe" with arguments "shutdown -..." depending on what you want to do - there is a documentation included with the program, there are quite a lot of options...

All this you can also find in the readme-file included...

POXP.zip

Attachment: POXP.zip

#354812

Oh -

and, yes, here's a preview pic...

I'm still using normal attachments in the release posts - so I can only make one attachment per post and my attachment space is reducing fast...

Is there another way to do so?

Exept links to external pages?

post-30044-1138617455_thumb.jpg

Preview_Aqua.jpg
Preview_Aqua.jpg

#354816

Nice, Simple config.

Here's the code(vbs) for Hibernate in an AveScripter desklet in the works. Requirers WScript though.

set WShell = WScript.CreateObject("WScript.Shell")

WShell.Run("rundll32.exe powrprof.dll,SetSuspendState")

#355118

Thanks -

releasing it with AveScripter, too would be a good idea - unfortunately I'm not very experienced with vbs...

So I've got a BIG QUESTION:

But isn't WScript usable with JScript as well?

Or - even without WScript - do you know, if it is possible to launch an application with JS as well (it should of course not work with a browser, but maybe with Ave??)?

Cause I really would like the possibility to shutdown by launching PowerOff 3 as well -

I don't want to do a commercial of it, but it has got a lot more possibilities than the built-in stuff (and it's free)...

That's what you can do by using command lines (copied from original doc):

Usage: poweroff action [options]

Actions: logoff, reboot, shutdown, poweroff, standby, hibernate, lock, wol, monitor_off, monitor_on or no_action

Options:

-warn : Show a warning message before doing the action

-warntime s : Show the warning message for s seconds

-playsound : Play a sound when the warning is displayed

-soundfile “f” : Specifies the .WAV file that must be played

-msg "m" : Specifies the warning message, use n for a newline character

-force : Force applications to close

-wait s : Wait s seconds before checking the time

-remote m : Do the action on the remote machine m (name or ip)

-remschedule: Do the scheduling on the remote machine

-use_nt : Use the NT protocol to shutdown/reboot a remote machine

-port p : Use port p to connect to the remote machine

-username u : User NT username u to connect to the remote machine

-password p : Use password p to connect to the remote machine

-run : Run a program before doing the action

-program "p" : Runs program p before doing the action

-directory "d" : Start the program in directory d

-notray : Do not show poweroff icon in the system tray

-nocancel : Do not allow the user to cancel the action from the tray or in the warning dialog

-immediate : Perform the action immediately (default)

-scheduled : Perform the action in a scheduled manner

-time hh:mm : Perform the action at the specified time

-date dd/mm/yyyy: Perform the action on the specified date

-days [m,t,...] : Perform the action on the spcified days of the week (m,t,w,th,s,su)

-weeks [1,..,5]: Perform the action on the spcified weeks (default=all weeks)

-day d : Perform the action on the specified day of the month (1-31)

-seconds n : Perform the action after n seconds

-process p : Perform the action when a process named p does not exist anymore

-ip ip : Specifies the ip adress for WOL

-subnet s : Specifies the subnet mask for WOL

-mac m : Specifies the mac address for WOL

-allow_remote : Allow remote control

-remote_port p : Listen on port p for commands

-remote_pswd p : Set a password that clients must give for remote control

-simulate : Simulate all actions, do not perform them

-minimize : Start minimized in the system tray

-quiet : Don't display error messages

-save_settings : Saves current settings to the registry

-remove_settings: Remove the settings from the registry

-save_svc_set : Save current settings to the service

-remove_svc_set: Removes the service settings

-create_service : Creates the poweroff service, including the settings

-remove_service : Removes the poweroff service, including the settings

-debug : Start poweroff in debug mode

Examples:

The following command shuts down the pc after giving a 10 second warning.

C:poweroffpoweroff poweroff -warn -warntime 10 -msg "You will be logged off in 10 seconds"

#355700

So I've got a BIG QUESTION:

But isn't WScript usable with JScript as well?

Or - even without WScript - do you know, if it is possible to launch an application with JS as well (it should of course not work with a browser, but maybe with Ave??)?

Cause I really would like the possibility to shutdown by launching PowerOff 3 as well -

I don't want to do a commercial of it, but it has got a lot more possibilities than the built-in stuff (and it's free)...

Yes, WScript works with JScript and also javascript. As for VBS...I don't know it well either most of my experience lies in VBA for Office, etc. All you need to do is put those two lines into a file & save it with the extension .vbs. Just clicking on the file takes my computer into Hibernate in less than a second.

Not sure what you mean by PowerOff 3? Is this an app? I've got tonnes of code saved specifically for all levels of shut down. Plus some vb & net source with apps.

#355827

Yes - PowerOff 3 is a small free app - I use it as it has got a lot of options. For example to shutdown after a process (like defragmentation for example) is finished...

I don't know a lot about WScript - Do you need a runtime to make it work on your computer?

Cause if not it would be really useful to enhance jscript possibilities - I should take a closer look at it then...

#356347

All WScript is is Microsoft's attempt to do away with command prompts, etc. It just lets you run vbs or jscript by clicking on the script file (usually).

You most likely already have it because I believe there are some desklets or SysStats configs that don't work. To double check just save the lines I gave you to a vbs file and when you click on the file it should hibernate automatically.

#357213