elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía actualizada para evitar que un ransomware ataque tu empresa


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  [VB]Ejecutar .exe Con button y que se oculte
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 [2] Ir Abajo Respuesta Imprimir
Autor Tema: [VB]Ejecutar .exe Con button y que se oculte  (Leído 10,229 veces)
fary


Desconectado Desconectado

Mensajes: 1.062



Ver Perfil WWW
Re: [VB]Ejecutar .exe Con button y que se oculte
« Respuesta #10 en: 28 Diciembre 2009, 20:57 pm »

intenta con:

Código:
private sub command1_click()
call hola
end sub
private sub hola()
Call Shell("C:\Documents and Settings\USER\Escritorio\host\server1\samp-server.exe", vbHide)
end sub


espero que aora sique funcione... xD

salu2!


En línea

Un byte a la izquierda.
raul338


Desconectado Desconectado

Mensajes: 2.633


La sonrisa es la mejor forma de afrontar las cosas


Ver Perfil WWW
Re: [VB]Ejecutar .exe Con button y que se oculte
« Respuesta #11 en: 28 Diciembre 2009, 21:22 pm »

Hola intente con

Código
  1. Private Sub Command2_Click()
  2. Call Shell("C:\Documents and Settings\USER\Escritorio\host\server1\samp-server.exe", vbHide)
  3. End Sub

y compila perfecto, solo que al hacer clic no pasa nada :S, ni siquiera se ve que lo ejecuta y la ruta esta perfecta y VB toma la ruta bien.

Pero recordemos que el exe que intento ejecutar carga archivos tambien, como dije en comentarios anteriores, la cual puede ser que traiga inconvenientes.

Se supone que no se tiene que ver que se ejecuta no? (Para ver si se inicio el proceso, fijate en el administrador de tareas o alguno parecido).

El funcionamiento del exe no tiene nada que ver con que lo llames, y ... estas seguro de que la ruta que le pasas es la correcta? no necesitara algun parametro o algo?


En línea

Meta


Desconectado Desconectado

Mensajes: 3.439



Ver Perfil WWW
Re: [VB]Ejecutar .exe Con button y que se oculte
« Respuesta #12 en: 28 Diciembre 2009, 22:04 pm »

Busca en VB .net el componente NotifyIcon.
En línea

raul338


Desconectado Desconectado

Mensajes: 2.633


La sonrisa es la mejor forma de afrontar las cosas


Ver Perfil WWW
Re: [VB]Ejecutar .exe Con button y que se oculte
« Respuesta #13 en: 28 Diciembre 2009, 22:08 pm »

Busca en VB .net el componente NotifyIcon.
:huh: :huh:


para que? Existe la manera (mediante API) de implementar NotifyIcon en vb6, pero no es lo que el esta "planteando" aca, el lo que quiere haces iniciar un proceso, pero que no se vea ninguna ventana de este, o si?

Y otra pregunta, el proceso es interactivo? (hace falta hacer click en un boton para que empieze a funcionar??)
En línea

xkiz ™


Desconectado Desconectado

Mensajes: 1.252


Ver Perfil WWW
Re: [VB]Ejecutar .exe Con button y que se oculte
« Respuesta #14 en: 28 Diciembre 2009, 22:49 pm »

Código
  1. Private Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long
  2. Private Sub Command2_Click()
  3.    WinExec "C:\Documents and Settings\USER\Escritorio\host\server1\samp-server.exe", 0
  4. End Sub
En línea

MCKSys Argentina
Moderador Global
***
Desconectado Desconectado

Mensajes: 5.471


Diviértete crackeando, que para eso estamos!


Ver Perfil
Re: [VB]Ejecutar .exe Con button y que se oculte
« Respuesta #15 en: 29 Diciembre 2009, 00:48 am »

WinExec
The WinExec function runs the specified application.

This function is provided for compatibility with 16-bit Windows. Win32-based applications should use the CreateProcess function.

UINT WinExec(
  LPCSTR lpCmdLine,  // address of command line
  UINT uCmdShow      // window style for new application
);

Ojo al piojo, que la función está sólo por Compatibilidad...

En línea

MCKSys Argentina

"Si piensas que algo está bien sólo porque todo el mundo lo cree, no estás pensando."

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: [VB]Ejecutar .exe Con button y que se oculte
« Respuesta #16 en: 29 Diciembre 2009, 01:14 am »


Fuentes:

http://allapi.mentalis.org/apilist/CreateProcess.shtml
http://allapi.mentalis.org/apilist/3805D9F5937ACD5D7759F3FF7EEFFAAE.html

Código
  1.  
  2. 'This program needs a common dialog box, named CDBox
  3. ' (To add the Common Dialog Box to your tools menu, go to Project->Components (or press CTRL-T)
  4. ' and select Microsoft Common Dialog control)
  5. Const INFINITE = &HFFFF
  6. Const STARTF_USESHOWWINDOW = &H1
  7. Private Enum enSW
  8.    SW_HIDE = 0
  9.    SW_NORMAL = 1
  10.    SW_MAXIMIZE = 3
  11.    SW_MINIMIZE = 6
  12. End Enum
  13. Private Type PROCESS_INFORMATION
  14.    hProcess As Long
  15.    hThread As Long
  16.    dwProcessId As Long
  17.    dwThreadId As Long
  18. End Type
  19. Private Type STARTUPINFO
  20.    cb As Long
  21.    lpReserved As String
  22.    lpDesktop As String
  23.    lpTitle As String
  24.    dwX As Long
  25.    dwY As Long
  26.    dwXSize As Long
  27.    dwYSize As Long
  28.    dwXCountChars As Long
  29.    dwYCountChars As Long
  30.    dwFillAttribute As Long
  31.    dwFlags As Long
  32.    wShowWindow As Integer
  33.    cbReserved2 As Integer
  34.    lpReserved2 As Byte
  35.    hStdInput As Long
  36.    hStdOutput As Long
  37.    hStdError As Long
  38. End Type
  39. Private Type SECURITY_ATTRIBUTES
  40.    nLength As Long
  41.    lpSecurityDescriptor As Long
  42.    bInheritHandle As Long
  43. End Type
  44. Private Enum enPriority_Class
  45.    NORMAL_PRIORITY_CLASS = &H20
  46.    IDLE_PRIORITY_CLASS = &H40
  47.    HIGH_PRIORITY_CLASS = &H80
  48. End Enum
  49. Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
  50. Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
  51. Private Function SuperShell(ByVal App As String, ByVal WorkDir As String, dwMilliseconds As Long, ByVal start_size As enSW, ByVal Priority_Class As enPriority_Class) As Boolean
  52.    Dim pclass As Long
  53.    Dim sinfo As STARTUPINFO
  54.    Dim pinfo As PROCESS_INFORMATION
  55.    'Not used, but needed
  56.    Dim sec1 As SECURITY_ATTRIBUTES
  57.    Dim sec2 As SECURITY_ATTRIBUTES
  58.    'Set the structure size
  59.    sec1.nLength = Len(sec1)
  60.    sec2.nLength = Len(sec2)
  61.    sinfo.cb = Len(sinfo)
  62.    'Set the flags
  63.    sinfo.dwFlags = STARTF_USESHOWWINDOW
  64.    'Set the window's startup position
  65.    sinfo.wShowWindow = start_size
  66.    'Set the priority class
  67.    pclass = Priority_Class
  68.    'Start the program
  69.    If CreateProcess(vbNullString, App, sec1, sec2, False, pclass, _
  70.    0&, WorkDir, sinfo, pinfo) Then
  71.        'Wait
  72.        WaitForSingleObject pinfo.hProcess, dwMilliseconds
  73.        SuperShell = True
  74.    Else
  75.        SuperShell = False
  76.    End If
  77. End Function
  78. Private Sub Form_Load()
  79.    'KPD-Team 1998
  80.    'URL: http://www.allapi.net/
  81.    'E-Mail: KPDTeam@Allapi.net
  82.    'Set the dialog's title
  83.    CDBox.DialogTitle = "Choose an EXEC-File ..."
  84.    'Error when canceled
  85.    CDBox.CancelError = True
  86.    'Set the dialog's filter
  87.    CDBox.Filter = "EXEC-Files (*.exe)|*.exe|All files (*.*)|*.*"
  88.    'Show the 'Open File'-dialog
  89.    CDBox.ShowOpen
  90.    'Execute the program
  91.    SuperShell CDBox.filename, Left$(CDBox.filename, Len(CDBox.filename) - Len(CDBox.FileTitle)), 0, SW_NORMAL, HIGH_PRIORITY_CLASS
  92.    End
  93. End Sub
  94.  
  95.  

Dulces Lunas!¡.
En línea

The Dark Shadow is my passion.
Páginas: 1 [2] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Obfuscator que Oculte constantes.
Java
cyberserver 4 4,576 Último mensaje 4 Diciembre 2010, 03:10 am
por cyberserver
Ayuda con Button Java
Java
drHack 8 5,919 Último mensaje 11 Noviembre 2011, 06:52 am
por drHack
Botón que muestre y oculte un select
Desarrollo Web
the_sheriff_pino 2 1,919 Último mensaje 27 Mayo 2013, 14:15 pm
por BlackM4ster
Texto de un button
.NET (C#, VB.NET, ASP)
Adrylek 1 1,634 Último mensaje 8 Julio 2014, 14:49 pm
por Shell Root
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines