How to add Eject/Shutdown/Restart Commands OD

I am using OD on a laptop and want to put Start menu commands such as "Eject" or "Shut Down" on OD. How do I add them?
9,046 views 16 replies
Reply #1 Top
Hi,

If you just want to make a short cut in OD which shuts down the computer, restarts it or logs off directly, link your OD short cut to "C:\WINDOWS\system32\shutdown.exe" and add in the field Arguments -s for shut down, -r for restart or -l for log off.

If you want to lauch the GUI "Shut Down Windows" that you usually access through the Start Menu > Shut Down button, so that you can choose between Shut down, Restart, log off and Stand by, using Windows menu, you will need to copy the following command line in a text file that you will name at your convenience, but with the extension .js:

(new ActiveXObject("Shell.Application")).ShutdownWindows();

Put the file whereever you want and link your OD button to it.

That should work fine (at least under XP).

Bye.
Reply #2 Top
Thanks drudrauf, worked perfectly.
Reply #4 Top
Search the Object Dock section here for the 'Syscmd' docklet. That will allow you to do whatever you want. Very useful.
Reply #5 Top
When you rename the text file with the js extension make sure you have the hide known file extensions unchecked in folder options so that you rename to a script file such as shutdown.js and not a text file such as shutdown.js.txt. You can then rehide the file extensions and create the dock entry as drudrauf advised..
Reply #6 Top
i hope someone can help me because thats what i´ve been looking for ever since i started using OD

1)so i made my text file with notepad and renamed it to .JS (shutdown.js)
2)i added an entry on my OD and placed that file in the shortcut.
3)i click on it, and instead of leading me to the shutdown dialog(turn off, restart, log off)... it opens wordpad ... what the hell!?!?

NOTE: im sure i made it right, i actually copied the following
(new ActiveXObject("Shell.Application")).ShutdownWindows();
and i have the extensions visible, so im sure its not "shutdown.js.txt"

ive tried many others, but the only ones ive found is the shutdown.exe -s -r -whatever cmd and i dont want those, i want to click the darn icon and the SHUTDOWN dialog to appear...

THANKS
Reply #7 Top
I just tested this procedure as follows:

- Open notepad
- Paste copied text - (new ActiveXObject("Shell.Application")).ShutdownWindows(); - from comment #1
- Saved file as shutdown.txt to My Documents
- Changed file extenstion to .js
- Created a new Dock Entry
- Right-clicked dock entry, used Browse button to browse to file and select it
- Clicked new Dock Entry with shutdown.js file designation
- Normal Shutdown dialog popped up with the three options

If the above steps do not work, and you still receive Wordpad, you might see if you have Wordpad designated to open JScript, or as your text editor for some reason - which may be opening to edit instead of allowing the script to run.
Reply #8 Top
i want to click the darn icon and the SHUTDOWN dialog to appear..

I use CloseWin http://www.tsoftcentral.com/tools/index.html

Reply #9 Top
If the above steps do not work, and you still receive Wordpad, you might see if you have Wordpad designated to open JScript, or as your text editor for some reason - which may be opening to edit instead of allowing the script to run.

If .js is asociated with a program, such as WordPad, what should the correct association be, in order for the script to run?

Reply #10 Top
If .js is asociated with a program, such as WordPad, what should the correct association be, in order for the script to run?


Recommended program = Microsoft(r) Windows Based Script Host

Found by browsing to "C:\WINDOWS\system32" and selecting "wscript.exe".
Reply #11 Top
Shazam! Thanx Corky.
Reply #13 Top
you sir, RULE!

you define what forums are for!!! i had notepad as the designated program...THANKS!
Reply #14 Top
i want to click the darn icon and the SHUTDOWN dialog to appear...


Just a suggestion... I use a flyout menu with logoff, restart & shutdown - i.e it takes the place of the shutdown dialog.


Posted via WinCustomize Browser/Stardock Central
Reply #15 Top
ok can someone explain how to make this flyout menu? I want to have the regular shutdown dialog and the logoff dialog so I can choose logoff or switch user. Any suggestions except Syscmd?
Reply #16 Top
Best. Forum post. Ever.
Now I can set up Diafragma's OD "Tempered Glass" and "Tempered Glass II" just as I wish.
you define what forums are for!!!