Thursday, September 3, 2009

Turn off the computer with VB 6 and the Command Prompt

Project time that we make the program to shutdown the computer. Our program is going to call shutdown.exe program's windows XP and above. You can modify this program as a sleep (timer) to turn off your own computer. To do so, follow these steps:

1. Open up the Visual Basic 6 programs and make your new project with 1 form

2. Fill the command button with the name: cmd captionnya Turn off Computer and Computer and adjust the width length captionnya button.

3.Isikan following code in cmdMatikanKomputer by pressing F7 Private Sub cmdMati_Click ()

Shell "shutdown.exe-s-t 10-f", vbHide
End Sub
Then save your project by pressing ctrl + S, then run by pressing F5. If you click Turn off Computer button, then your program will automatically execute shutdown.exe windows property.
The following explanation and the parameters of the use shutdown.exe:
shutdown.exe [spasi] -i artinya menampilkan GUI dan paramter ini harus pertama ditaruh" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">- Font-weight: bold; "> shutdown.exe [space]-i mean GUI display and the first paramter must be placed
shutdown.exe [spasi] -l artinya log off (tidak bisa dengan pilihan -m )" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">-font-weight: bold; "> shutdown.exe [space]-l means to log off (not by choice-m)
shutdown.exe [spasi] -s artinya shutdown" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">- Font-weight: bold; "> shutdown.exe [space]-s means shutdown
shutdown.exe [spasi] -r artinya shutdown dan restart komputer" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">- Font-weight: bold; "> shutdown.exe [space]-r means to shutdown and restart the computer
shutdown.exe [spasi] -s artinya gagalkan shutdown" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">- Font-weight: bold; "> shutdown.exe [space]-s means shutdown prevented
shutdown.exe [spasi] -m \\nama komputer artinya remote shutdown komputer lainnya" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">- Font-weight: bold; "> shutdown.exe [space]-m \ \ computer name that is remotely shutdown other computers
shutdown.exe [spasi] -t dd artinya shutdown komputer dengan waktu detik" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">- Font-weight: bold; "> shutdown.exe [space] dd-t means computer shutdown time seconds
shutdown.exe [spasi] -c artinya shutdown dengan mengisi komentar maksimum 127 char" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">- Font-weight: bold; "> shutdown.exe [space]-c shutdown means a comment by filling out a maximum 127 char
shutdown.exe [spasi] -f artinya shutdown dengan mematikan aplikasi yang lagi jalan, Anda juga bisa memakai shutdown.exe dengan masuk ke command prompt lalu ketikkan shutdown.exe -s -f -t 10" onmouseover="this.style.backgroundColor='#ebeff9'" onmouseout="this.style.backgroundColor='#fff'">- Font-weight: bold; "> shutdown.exe [space]-f means shutdown by turning off the back road applications, you also can use shutdown.exe to go to command prompt and then type shutdown.exe-s-f-t 10 -c "Your computer will die" Thank you.

0 comments:

Post a Comment