Shutdown, Restart and Log Off your computer using VB 6.0


VB 6.0 can be used to invoke shell script commands of the windows api with a code.
This shell script command can be used to perform shutdown or restart tasks..

Its code is as follows :
shell ("shutdown.exe -s -t00")

NOTE : In the above code, -s indicates shutdown, we can also use -r for restart and -l for log off.
also -t represents the time interval before the performable operation and the tow digit number next to -t is the interval in seconds.

If you enjoyed this post, subscribe for updates (it's free)

Shutdown other Computer

How can i turnoff another computer using mine in our network ? Help me pls :(

LAN Chat application

How can i use Visual Basic 6.0 or 2008 to design an Instant messaging application for a small network (peer-peer) or (Local Area Network) with user picture display for the client and server?

vb6 code

i want code in vb6 to turn on/off the power interface sytem

Shutdown

This is true command for shutdown in VISUAL BASIC6.0 and garranted working

Call Shell("Shutdown /s") 'to shutdown

Call Shell("Shutdown /r") 'to restart

Call Shell("Shutdown /l") 'to log off

Call Shell("Shutdown /a") 'to Abort

It's Not Timer ?

It's Not Timer ?

Question

I wondering to change the system password using of visual basic form.....but i dont know how to implement it....so any can one give some idea about it

vb shutdown

thank you for posting this....

shutdown

thank you for posting this....

Log off system only not shutdown

how to log off system in vb6.0.Please help me.I want to log off only not shutdown.

Using combobox

If anyone knows the code used to set a command if something is selected from a combobox,please email the code to me.

Networking wit vb using shell commands

How to use shell commands to
- shut down/restart/log off all systems in a network at once?
- find all the active process in any machine on the network and kill it?
- send message to all the machines in a network?

Pls can anybody help me out to code for these using shell commands in VISUAL BASIC..

Visual basic 6.0

How to use shell commands to
- shut down/restart/log off all systems in a network at once?
- find all the active process in any machine on the network and kill it?
- send message to all the machines in a network?

Pls can anybody help me out to code for these using shell commands in VISUAL BASIC..
and send me on this e-mail: rizwan140@gmail.com

shut down

coding for shutdown the system automatically at specified time..

Solution

take one timer
and set the timer interval to 1000
code is here
take time from user when will be shut down the computer
for example tm="12:00:12 AM"
private sub timer1()
{
if(tm=Datevalue(now)) then
msgbox("System is going to shutDown")
Shell "shutdown -r -t 99 -c "
end if
}

coding for shutdown the

coding for shutdown the system automatically at specified time..

shut down for system

shut down for system

Shutdown, Restart and Log Off

You can Shutdown, Restart and Log Off using API calls rather than shell ("shutdown.exe -s -t00")

It won't matter who is logged in the system as long as that user can access or see the short-cut to your app.

You need to join a forum that allows download options because I can't post an example on here.

P.S. Why is this posted in Tutorials when it isn't one or you're not asking for one?

Keith
www.martin2k.co.uk/forums/

I've been programming with VB for 13 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning

ShutDown

The command for shutdown is not working Can i have some suggestions

thanks

thanks

Startup

So it's ok but... what if i copy this program at startup??Can I abort this??

Question

Hello There, I'm wondering, what if the current logged user isn't allowed or wasn't given administrative privileges, this creates an error when the above code is being executed. Any alternatives? Thanks.

Very Helpfull Visual Basic Function

Thank you for posting this - this is very helpful. I really appreciate others contributing to the site. THANKS!

forgot one

use -a to abort shutdown

you can alsow do it in a .bat file

ShutDown -a
Loop

that will prevent any annoying teachers from shuting down ur PC in school ^^

lacking

there is lacking there.. where should that code be written?

RE:lacking

put it in form load to use at start of in a command to start it manually.

lacking

there is lacking there.. where should that code be written?