VFP 6 Ejecutar ShellExecute

321 views
Skip to first unread message

Juan Carlos M

unread,
Apr 19, 2021, 4:18:18 PM4/19/21
to Comunidad de Visual Foxpro en Español

Saludos Amigos

La siguiente tal vez sea una pregunta muy básica, pero he investigado en internet y no he encontrado mi error, por lo cual les pido apoyo.

Es posible ejecutar algo así en el archivo PRG inicial de un proyecto ?

Me manda el siguiente error 


shellexecute.PRG  No se encuentra

solo intento ejecutar un archivo *.REG que realiza diversas tareas así:


lsRutaActual = SYS(5)+CURDIR()+ "ACT_SERVER_SICSEJ_UPDATE.REG"

MessageBox (lsRutaActual)
lvalReturnShellUpdate = shellexecute(0, "open", lsRutaActual, "", "", 1)





Gracias de antemano










ERROR_SHELLEXECUTE.png

Sergio Rojas

unread,
Apr 19, 2021, 4:46:29 PM4/19/21
to Comunidad de Visual Foxpro en Español
La forma correcta de invocar ShellExecute es:

                LOCAL loShell
loShell = CREATEOBJECT("Shell.Application")
loShell.ShellExecute( lsRutaActual  )
RELEASE loShell

Zarlu

unread,
Apr 19, 2021, 5:04:30 PM4/19/21
to Comunidad de Visual Foxpro en Español
Buenas tardes Juan Carlos!

Te dejo un ejemplo:
DECLARE INTEGER ShellExecute IN Shell32;
  INTEGER hwnd,;
  STRING @lpOperation,;
  STRING @lpFile,;
  STRING @lpParameters,;
  STRING @lpDirectory,;
  SHORT nshow
ShellExecute(0,'open',"c:\ver1.xls","","",1)

Suerte
zarlu
Chetumal, Quintana Roo, México

Juan Carlos M

unread,
Apr 19, 2021, 6:17:52 PM4/19/21
to Comunidad de Visual Foxpro en Español

Mil Gracias Zarlu  y shrojas   funcionó  Excelente !!!
Reply all
Reply to author
Forward
0 new messages