Hello,
I would need an example of how to use shellexec or winexec to run a program in the program's directory.
Best regards
Otto
shellexec or winexec
shellexec or winexec
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
Re: shellexec or winexec
Hello,
as a workaround I tried with a bat-file.
cd\
cd xwinhotel
call xwinhotel.exe
This is working.
Best regards
Otto
as a workaround I tried with a bat-file.
cd\
cd xwinhotel
call xwinhotel.exe
This is working.
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
Re: shellexec or winexec
Is that what you mean ?
cPt:=CurDrive()+':\'+CurDir()
SHELLEXECUTE( 0, 0, cPt+"\"+MyFile, 0, 0, 1)
cPt:=CurDrive()+':\'+CurDir()
SHELLEXECUTE( 0, 0, cPt+"\"+MyFile, 0, 0, 1)
Re: shellexec or winexec
function MyRun( cComando, nStyle, lWait, lShowResult )
local oShell, nRetorno
IF valtype( nStyle ) != "N"
nStyle := 0
ENDIF
IF ValType( lWait ) != "L"
lWait := .T.
ENDIF
IF ValType( lShowResult ) != "L"
lShowResult := .F.
ENDIF
oShell := CreateObject( "WScript.Shell" )
IF !GetEnv( "OS" ) == "Windows_NT"
cComando += "start " + cComando
ENDIF
TRY
nRetorno := oShell:Run( "%comspec% /c " + cComando, nStyle, lWait )
CATCH
MsgStop("ERRO NO ENVIO DO COMANDO!", "MYRUN")
END
IF lShowResult .and. nRetorno > 0 .and. nRetorno <= 32
MsgInfo( "Erro Win_Run(): " + ltrim( Str( nRetorno ) ), "Win_Run - Error" )
ENDIF
oShell := NIL
Return nRetorno = 0
local oShell, nRetorno
IF valtype( nStyle ) != "N"
nStyle := 0
ENDIF
IF ValType( lWait ) != "L"
lWait := .T.
ENDIF
IF ValType( lShowResult ) != "L"
lShowResult := .F.
ENDIF
oShell := CreateObject( "WScript.Shell" )
IF !GetEnv( "OS" ) == "Windows_NT"
cComando += "start " + cComando
ENDIF
TRY
nRetorno := oShell:Run( "%comspec% /c " + cComando, nStyle, lWait )
CATCH
MsgStop("ERRO NO ENVIO DO COMANDO!", "MYRUN")
END
IF lShowResult .and. nRetorno > 0 .and. nRetorno <= 32
MsgInfo( "Erro Win_Run(): " + ltrim( Str( nRetorno ) ), "Win_Run - Error" )
ENDIF
oShell := NIL
Return nRetorno = 0
Re: shellexec or winexec
To run a second program in the same directory
Code: Select all
#include "FiveWin.ch"
FUNCTION Main()
LOCAL cPathProgr := cFilePath( GetModuleFileName( GetInstance() ) )
WinExec( cPathProgr + "PROGR2.EXE" )
RETURN NIL
Re: shellexec or winexec
Hello,
thank you all for your help.
I will test all the solutions on the weekend.
Best regards
Otto
thank you all for your help.
I will test all the solutions on the weekend.
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************