Welcome Guest ( Log In | Register )

      
Discover the best free computer help!
Learn more about Geeks to Go by taking the tour. Spyware, virus, trojan, fake security or privacy alerts? Read the malware cleaning guide.
 
Reply to this topicStart new topic
I'm a n00b but please help me out.
ian walker
post Jan 22 2006, 07:37 PM
Post #1


New Member
*
Posts: 5
OS: XP



Okay so, I'm trying to make a button that will shut down a computer when hit. The problem is, I can't figure out what is wrong with the code I'm using.


____________________________________________________________
ProcessStartInfo startinfo = new ProcessStartInfo("shutdown.exe","-s");
Process.Start(startinfo);
____________________________________________________________

Should that work? Am I doing something wrong?


Help please.
Go to the top of the page
 
+Quote Post
Keith
post Jan 22 2006, 08:03 PM
Post #2


Philanthropical Physiognomist
Group Icon
Posts: 20,563
OS: Windows 98 Second Edition - XP Professional - Office 2003 Professional - XP Home Edition - Office XP Professional - Vista Home Premium - Vista Ultimate



You could use this

shutdown.exe will NOT work on Windows 95, 98, 98 SE and ME!

shutdown.exe is a command line utility. This means you have to first run Command Prompt (cmd.exe) from the Start menu and then run shutdown with any combination of switches.

Alternatively, you can also create a shortcut to the shutdown.exe and shutdown your computer by double clicking the icon on your desktop.

To run the shutdown.exe from the Command Prompt:
1. On the Start menu click Run.
2. Type cmd.exe and click OK.
3. Go to the folder with my shutdown utility. If my shutdown.exe is in c:\shutdown type "cd /d c:\shutdown" in the command line. If you fail to do this, you will run the shutdown.exe that is built-in into Windows XP.
4. You can get a list of all supported switches by typing shutdown.


To create a shortcut to shutdown.exe:
1. Right click your dekstop and select New and then click Shortcut.
2. Click the Browse button and go trough your hard drive and select my shutdown.exe. Click OK.
3. In the box with the path to the shutdown.exe add a switch depending on the action you want to perform. For instance, if you want to shutdown your computer add -u in the box. For all supported switched see below.
4. Click Next.
5. Type a descriptive name in the box, like Shutdown computer and click Finish.
6. You can now shutdown your computer by double clicking the icon on your desktop.


Supported switches:
-l -> Log Off.
-u -> Shutdown (Turn Off).
-r -> Restart.
-h -> Hibernate.
-s -> Stand By (Sleep).
-f -> Force the action.
-c -> Cancel a running shutdown.
-t sec -> Delay for number of seconds.


Usage examples:


Log off current user and forces quick shutdown of applications: shutdown -l -f
Initate standby in 30 seconds: shutdown -s -t 30
Cancel all initiated actions: shutdown -c
Shut the computer down: shutdown -u
Restart the computer: shutdown -r
Hibernate the computer: shutdown -h
Wait 10 seconds before shutting down the computer: shutdown -u -t 10
Assign original Windows icons to the shortcut:
1. Right click on the shortcut to the shutdown.exe you created on the dekstop and select properties.
2. Click the Change icon button. A dialog will appear. Just click OK.
3. Click the Browse button and select \windows\system32\shell32.dll and click Open. 4. New dialog will appear listing all the icons in this file. You will also find the same icons that appear on your Start menu. Select the icon you would like to assing to the shortcut and click OK.
5. Click OK.


Assign shortcut key:
1. Right click on the shortcut to the shutdown.exe you created on the dekstop and select properties.
2. Click in the Shurtcut key box and a, like S. This will configure the shortcut to run when you press Ctrl + Alt + S on your keyboard (you have to press all three keys Ctrl, Alt and S at the same time).
3. Click OK.


http://www.budja.com/shutdown/
Go to the top of the page
 
+Quote Post
ian walker
post Jan 22 2006, 11:22 PM
Post #3


New Member
*
Posts: 5
OS: XP



Well, here was my idea, I wanted to put a shutdown button on my website disguised as something else... (to freak people out when their computer suddenly shut down). So the shortcut doesn't really work, and all I got from cmd.exe was:

-i
-l
-r
-s
etc blah blah

Sorry, I'm noobin' out over here

Go to the top of the page
 
+Quote Post
ian walker
post Jan 23 2006, 05:27 PM
Post #4


New Member
*
Posts: 5
OS: XP



Bump, lol

please help.
Go to the top of the page
 
+Quote Post
Keith
post Jan 23 2006, 05:38 PM
Post #5


Philanthropical Physiognomist
Group Icon
Posts: 20,563
OS: Windows 98 Second Edition - XP Professional - Office 2003 Professional - XP Home Edition - Office XP Professional - Vista Home Premium - Vista Ultimate



The intended use is dubious

Its success unlikely
Go to the top of the page
 
+Quote Post
ian walker
post Jan 23 2006, 05:55 PM
Post #6


New Member
*
Posts: 5
OS: XP



QUOTE(Keith @ Jan 23 2006, 03:38 PM) [snapback]538552[/snapback]

The intended use is dubious

Its success unlikely


It's harmless fun.
Go to the top of the page
 
+Quote Post
Keith
post Jan 23 2006, 07:13 PM
Post #7


Philanthropical Physiognomist
Group Icon
Posts: 20,563
OS: Windows 98 Second Edition - XP Professional - Office 2003 Professional - XP Home Edition - Office XP Professional - Vista Home Premium - Vista Ultimate



If it were possible (legally and without resorting to virus writing) it would have been done, and 99% of all PC's would be in a reboot cycle

We can all hope that nobody ever bothers to figure out a way to do it

Go to the top of the page
 
+Quote Post
ian walker
post Jan 23 2006, 11:05 PM
Post #8


New Member
*
Posts: 5
OS: XP



Lol, well I'm workin' on it smile.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


RSS Time is now: 1st December 2008 - 07:37 PM
Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk.