Command To Shutdown / Restart Computer When Press A Button

Jan 16, 2009

i am looking for a command to shutdown/restart my computer when i press a button. can anyone tell me the code?

View 25 Replies


ADVERTISEMENT

Restart Application With A Button Press?

Apr 22, 2012

Is it possible to restart your application with a button press?

View 1 Replies

Computer Shutdown By Button?

Feb 23, 2011

I've written a program which I propose to give a local club, which sadly may be'attractive' to pirates so I propose to build in some sort of anti-copying feature.My idea is to hide a file in a folder somewhere in the club's laptop, then on program start up I'll check to see if that file exists and if it's not there, which it's unlikely to be on a pirates machine, I'll flag up a message box saying that if they have a legitimate reason to install the program on a different machine they'll have to contact myself.By way of nuisance value, pressing the 'OK' button on the message box will cause the machine running, what I'm assuming is a pirated copy, to shut down.I've been looking at the VB.NET forum and MSDN for ideas as to how to achieve this and the general opinion seems to be:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Process.Start("shutdown", "-s")

[code].....

View 23 Replies

ShutDown And Restart

Jun 11, 2010

I am making a program that takes a time input from the user or a countdown amount and when that time comes it will shutdown or restart or log off the computer. I know how to make the timing code and everything else but i don't know how to shutdown or restart or log off.

View 1 Replies

VS 2008 Log Off - Shutdown - And Restart

Dec 24, 2009

I'm trying to create a way for the User of my application to Log Off, Shutdown, or Restart the PC.

The idea is that User can more quickly access these options from my application and if they choose, force these actions instead of waiting for the OS to respond.

Here's how I'm trying to do it:

CODE:

Log Off works just fine. It's shutdown and restart that doesn't work. From the research that I've done, the Consts seem fine and the function obviously works correctly because Log Off works. I am running the application as an administrator, so that should affect it.

View 5 Replies

Restart Shutdown Standby For PocketPC?

Oct 13, 2009

How can i do this for pocketpc? I have tried this but didn't work since its made for windows not for windows mobile. Can anyone help me? Please.Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags as Long, ByVal wReserved as Long) as Long

Private Const EWX_FORCE = 4 'Force any applications to quit instead of prompting the user to close them.Private Const EWX_POWEROFF = 8 'Shut down the system and, if possible, turn the computer off.Private Const EWX_LOGOFF = 0 'Log off the networkPrivate Const EWX_REBOOT = 2 'Perform a full reboot of the systemPrivate Const EWX_SHUTDOWN = 1 'Shut down the system

[code]....

View 1 Replies

VS 2010 Shutdown & Restart PCs Connected Via LAN?

Feb 4, 2011

In my client-server app, I wish to add a facility to control the client systems from the server.I mean, I would like to know how to add a facility to shutdown or restart particular client machines using my app., which will be all in a LAN connection.

View 5 Replies

API Call To Detect Windows Shutdown Or Restart?

Jun 9, 2010

I want to detect when employees in our company are shutting down or restarting their computers. Is there a Windows API Call that will do that which I can hook onto? I found WindowsExitEX but it actually restarts the computer!

View 2 Replies

Detecting Shutdown, Logoff, Restart, Sleep

Dec 25, 2007

What i wish to find is a message or the like that I can use to detect between specific 'shutdown' like events, ie: I wish to be able to find the difference between a shutdown, restart, logoff and sleep initiation.

The problem i have found (as displayed below) is using oClosingEvent.CloseReason the return types provide no further information other then the WindowsShutDown constant (the others are obviously irrelevant in this case).

Private Sub frmMain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Dim oClosingEvent As System.Windows.Forms.FormClosingEventArgs

[Code]....

View 9 Replies

Remote Shutdown/Restart/Lock Administration?

Jul 25, 2008

I work for a school system and I have teachers that run computer labs. I am trying to get an application that will allow them to do the following remotely:ShutdownRebootLockLog OffLog InI am not a good coder and I know what I have is not efficient and probably not what I need. I have found the following code that will Shutdown, Reboot, and Lock a remote

View 3 Replies

Send Keys - Make Your Computer Press A Button?

Sep 17, 2010

I was wondering if there is any other way to make your computer press a button. Okay Right now i have this...

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer

View 7 Replies

How To Restart A Computer

Jun 8, 2009

If I had a command button and I wanted it to shutdown or restart there computer when they want to.can I just use a simple shell command?

View 2 Replies

Restart Computer In VB?

Feb 11, 2012

Is there any code I can put in my VB.NET application that restarts someone computer when it runs? No external EXEs or DLLs.

View 3 Replies

Restart Computer To Mac Partition In VB 2008?

Aug 15, 2011

I have to create this program for school to restart a bootcamped mac back onto mac from windows with an application made in visual basic.So I need my computer to restart which I have successfully completed. Now I just want to find out how to get the application to make my computer restart on the Mac Partition ( E: ).

View 1 Replies

Shutdown Network Computer Acces Denied

Jul 27, 2010

I'm developing an application that controls the rest of the machines inside a local network and when i try to send a command to Shutdown remotely a pc in this LAN, i get the error Acces Denied, i've changed the Security Policies of that machine por testing purpose at:[code]Changed to this option "Classic - local users authenticate as themselves" as i read in other posts.But still getting the same error, i dont know what's wrong... all OS on my LAN are Windows XP Pro Sp2, and all of them boot Administrative user without entering any password.

View 9 Replies

Application.Restart With Different Command Line Arguments?

Jan 27, 2010

Is it possible to restart a VB.NET application, but with different command line arguments than it originally had? Here is the challenge. I want to write a single instance application. If the second instance has the same CL args as the first, then the built-in behavior is fine (second instance never opens, e.BringToForeground=True brings 1st instance to foreground, everything is great). But if the second instance has different CL args, then I would like the first instance to close and the second instance to start. However, once you mark a VB.NET app as "single instance only", it appears that you can never get the second instance. I think: OK, fine, I can just restart my first instance from the StartupNextInstance event. But how do I use the new command line arguments from the second instance? The Restart() method does not take CL args that I can see.

View 5 Replies

Restart Service Like Apache Through Command Line?

Jan 2, 2011

restart service like apache through command line or vb.net once in a while apache in my computer hang and I just got to restart that.

View 3 Replies

Press A Button - If I Clicked The Button In Form2 It Would Automaticlly, Click The Button In Form1?

Oct 30, 2010

Using 2 forms how would I click one button, from another form? ie In VB 4,5,6, I would used to do it as:-

Form 1:

private sub Command1_Click()

msgbox "Say Hello"

End Sub[code].....

If I clicked the button in form2, it would automaticlly, click the button in form1. Do I, do it the same way in VB Express or has it changed?

View 5 Replies

Running A Command On Key Press?

Jan 21, 2009

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate("test" + txturl.Text)End Sub

Thats my code, however i want to run that code there if the user presses the enter key as well.

View 5 Replies

Make A Macro Type Program - Get Computer To Press A Key?

Apr 8, 2012

I can't belive I can't figure this out but Im trying to make a macro type program. I just need to computer to press a key. Here is my outline:

Step 1: Open Crafting Menu

Key: T

Step 2: Select Farming

Position:

Step 3: Select Crop Field

Position: User Defined

Step 4: Use Optional Yes or No

If Yes Position:

Step 5: Make Number

Position:

[code]....

View 18 Replies

VS 2008 - Calling Sub When User Press Enter On Textbox (Computer Beeps)

Nov 10, 2011

I may be doing this wrong but I want to call a sub when the user presses enter on a textbox. The sub then shows a window in dialog mode. When I close that window, the computer makes a ding sound. Why is that? Is there a better way for detecting enter being presses on a textbox and not getting that ding?

If e.KeyChar = vbCr Then
LookupItem()
End If

View 3 Replies

Dynamically Created Excel Button Disappears On Restart

Apr 8, 2012

I have code for a user created button that gets placed on a custom ribbon control, within a custom drop-down menu.[code]...

View 2 Replies

VS 2008 - Code That Will Reload A Form - Restart Level Button

Feb 11, 2010

I'm looking for some code that will reload a form, so its like a Restart Level button which when clicked will reset the form to its original look.

View 1 Replies

Console Publish - Type In The Command And Press Enter The But It Closes The Window?

Dec 31, 2011

I have made a command line with arguments and i published it. But when i type in the command and press enter the but it closes the window.

View 3 Replies

Make A Button Press A Certain Button In Another Application?

Sep 26, 2009

I have a few questions:

1. how do I make a button press a certain button in another application? (i.e - for example it goes to application "iexplorer" and press insert, home, a, b, or other button in the keyboard)

2. How do I make a virtual keyboard (for example a button opens form 2 or 3 and when you click on a button in the keyboard it goes to a certain text box in form 1)?

View 2 Replies

Running A Command That Will Run On Every Computer

May 13, 2011

I have this code which gives me all of the information I need regarding tasks, information etc. I have it all shelled into a VB program and I want to be able to run this from one computer and have it return the data from all computers on the domain.[code]I have script that will list all users on the domain, can I implement that or is there an easier way? If I could search the entire domain for a specific file that would work too.At the moment I just need all the data returned to a text file, I am not worried about it being sorted, or how long a process like this would take.

View 1 Replies

Make The Grid View Button(Time In) Invisible Until The User Press Time Out Button - ASP.NET

Mar 20, 2009

i want to make the Grid view Button(Time In) invisible until the User press Time Out Button. Once the user press the Time Out Button,Time in Button must be shown

View 2 Replies

Key Press Instead Of Button?

Feb 13, 2011

I have a form with a panel on it that is attached to 3 buttons that when pressed display a different image.How do I make the panel cycle through the images on pressing the "Z" key for example?

Public Class Master
Private Sub Master_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

View 1 Replies

Download A File By Using The My.Computer.Network.DownloadFile 'command?

Jan 30, 2011

I try to download a file by using the My.Computer.Network.DownloadFile 'command'. The path i use is this: [URL]. Everytime i want to download it, it downloads the HTML file of this zippyshare page! I want just the .mp3. How can i do that?

View 4 Replies

TCP Protocols - Sending Command To Specific Port On Same Computer

Mar 10, 2011

I am working on writing a program that needs to send a command to a specific port on the same computer, I have that working fine. There is another piece of software running that is listening to that port for some commands (read on).
Dim myTcpClient As New TcpClient
myTcpClient.Connect("127.0.0.1", 61225)
Dim networkStream As NetworkStream = myTcpClient.GetStream()

However when I try to send a command I get no response...
Dim outStream As Byte() = System.Text.Encoding.ASCII.GetBytes("0x33")
networkStream.Write(outStream, 0, outStream.Length)
networkStream.Flush()

I have been given a list of protocols that I need to send to that port. What I have been told is that the size (in byes) is 1 and the value is "0x33" with no parameters. I am completely new to sockets and sending data through tcp.

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved