RE:funcion shell(urgente)
Pues yo lo haria de esta manera...
If ExisteArchivo(apppath() & "WindowsApplication2.exe") Then
Dim spath As String, sexe As String, apppath As String, sfile As String
sfile = "WindowsApplication2.exe"
'saber el path donde se esta ejecutando el EXE
spath = System.Reflection.Assembly.GetExecutingAssembly.Location
sexe = Dir(spath)
'saca el path y el archivo que deseamos ejecutar
apppath = Microsoft.VisualBasic.Left(spath, Len(spath) - Len(sexe)) + sfile
'---------------------------------------------------------------------
Dim Proc As New System.Diagnostics.Process
Proc.StartInfo.FileName = apppath
Proc.Start()
'------------------------------------------------------------------
' o en su defecto si no se utiliza el PROC
shell(apppath)
Else
Mensaje("El archivo EXE no existe...")
End If
' sacar el path donde esta el EXE que vamos a ejecutar que debe de estar alojado
por supuesto donde esta el EXE primario.
Public Function AppPath() As String
'Devuelve el path del archivo .exe
Dim sPath As String, sExe As String
sPath = System.Reflection.Assembly.GetExecutingAssembly.Location
sExe = Dir(sPath)
AppPath = Left(sPath, Len(sPath) - Len(sExe))
End Function
' verificar si existe el EXE que deseamos ejecutar
Public Function ExisteArchivo(ByVal sNombreArchivo As String) As Boolean
Try
If Trim(sNombreArchivo) = "" Then
MensajeError("Nombre de archivo no válido")
Else
ExisteArchivo = Dir(sNombreArchivo) <> ""
End If
Catch ex As Exception
MensajeError(Err.Description)
End Try
End Function