Bienvenido: ( Identificarse | Registrarse )      
Foros de Trucos Windows
 
Closed TopicStart new topicStart Poll

Outline · [ Estándar ] · Lineal+

> reiniciar mi pc con visual basic, reiniciar mi pc

bredda
post Jun 22 2006, 07:37 PM
Publicado: #1


Unregistered









holas amigos empieso a programar ... y ahora tengo una inquietud... quisiera saber si se puede reiniciar mi pc con una instruccion desde visual basic...y de haberlo quisiera me manden el codigo ... xfa agradesco su atencion...bye!!!


Go to the top of the page
+Quote Post
rob1104
post Jun 23 2006, 01:07 AM
Publicado: #2


Xbox Live... The best thing ever happened around videogames
Group Icon

Grupo: Moderadores
Mensajes: 1.665
Registrado: 7-March 05
Desde: Matamoros, Tamaulipas, Mexico
Miembro nº: 93.342



Depende la version de win2 bro, pero es muy facil smile.gif

Hay varias formas, aqui te van 2

Con la API de windows (la dificl tongue.gif)
En un formulario agrega un boton (el name sera command1) y pega el sig. codigo
CODE
Private Declare Function ExitWindowsEx& Lib "user32" (ByVal uFlags&, ByVal dwReserved&)

Private Sub Command1_Click()
Dim i as integer
i = ExitWindowsEx(2, 0&) 'Reinicia el Sistema
End Sub



Y la facil (Creo que solo funciona para xp y basados en nt)
En un formulario agrega un boton (command1) y pon el sig. codigo
CODE
Private Sub Command1_Click()
   Dim i As String
   i = Shell("shutdown -r")
End Sub


Un saludo bye1.gif


User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
Closed TopicTopic OptionsStart new topic

Collapse

> Topicos similares

errores al reiniciar LarsR 92 11 Oct 8 2008, 11:14 PM
By: Caito
Reinstalar Vista Basic OEM sin disco vemv91 153 4 Sep 26 2008, 08:15 PM
By: vemv91
Visual Basic 6.0 Se Cierra... :( Lizeth22 126 3 Sep 25 2008, 09:06 PM
By: vitrox2007
Problema Visual Basic 6 y XML Lizeth22 55 3 Sep 24 2008, 07:22 AM
By: rob1104
Apagar o reiniciar...una aventura Bettypc 124 1 Sep 21 2008, 03:22 AM
By: koyaz73