ShellExecute() set as wait run

Post Reply
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

ShellExecute() set as wait run

Post by ShumingWang »

Hi!
prg:
ShellExecute(...)
msginfo("2")

Msginfo() will be run before shellexecute closed , how to set shellexecute, after it is closed, then run msginfo() ?
TKS!
Shuming Wang
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

Re: ShellExecute() set as wait run

Post by Jack »

I think you should use WAITRUN(...)

WaitRun("notepad.exe ERROR.TXT")
User avatar
mag071
Posts: 139
Joined: Thu Feb 02, 2006 12:09 pm
Location: Venezuela
Contact:

Re: ShellExecute() set as wait run

Post by mag071 »

Hi;

MsgRun( "MsgRun() Run Wait", "From FWH 17.05", { || ShellExecute(...), MsgInfo( "2" ) }, oWnd )
Mario Antonio González Osal
Venezuela
m a g 0 7 1 @ g m a i l. c o m
User avatar
richard-service
Posts: 583
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Contact:

Re: ShellExecute() set as wait run

Post by richard-service »

Hi Mr.Wang
I lose my WeChat account. so my new WeChat ID is fivetech_taiwan. please add it.
I have your TMySQL question.
Thanks a lot.
Regards,

Richard

Harbour 3.2.0dev (r1904111533)/xHarbour 1.2.3 Intl. (SimpLex) (Build 20180818) => Borland C++ v7.4
xHarbour 0.99.71 (SimpLex) => Borland C++ v5.5
MySQL v5.7 /ADS v12
Harbour 3.2.0dev (r1603181642) => Borland C++ v7.4 64bit
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: ShellExecute() set as wait run

Post by ShumingWang »

wairun() do not execute paraments as " mysqldump --host 192.168.1.200 -u root -p -C mydatabase>d:\back\mysqldatebas0001"
msgrun still run msginfo() before shellexecute() closed.
Thanks all!
Regards!
Shuming Wang
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: ShellExecute() set as wait run

Post by Enrico Maria Giordano »

ShumingWang wrote:wairun() do not execute paraments as " mysqldump --host 192.168.1.200 -u root -p -C mydatabase>d:\back\mysqldatebas0001"
Yes, it does:

Code: Select all

WaitRun( "mysqldump --host 192.168.1.200 -u root -p   -C mydatabase>d:\back\mysqldatebas0001" )
I'm not sure about redirection, though...

EMG
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: ShellExecute() set as wait run

Post by ShumingWang »

With aitrun() not success , seems immediatley closed.
Shuming Wang
sreerajklm
Posts: 5
Joined: Tue Sep 23, 2014 5:22 am
Location: Kochi, India

Re: ShellExecute() set as wait run

Post by sreerajklm »

Try this,

Code: Select all

MsgWait("Mysql database backup","Backup",Winexec( "c:\mysql\mysqldump --host 192.168.1.200 -u root -p   -C mydatabase>d:\back\mysqldatebas0001"))
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: ShellExecute() set as wait run

Post by ShumingWang »

Still not success , after input mysql password, seems immediatley closed.
Shuming Wang
MGA
Posts: 1219
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá
Contact:

Re: ShellExecute() set as wait run

Post by MGA »

Try this,


cArquivoBAT := 'filebat.bat'
cComando := 'mysqldump --host 192.168.1.200 -u root -p -C mydatabase > "d:\back\mysqldatebas0001" '

MsgRun( 'Aguarde...',, { || ExecutaComando( cArquivoBAT, cComando ) )

/******************************************************************************/
static procedure ExecutaComando( cArquivoBAT, cComando )
/*
*/
if !CriaArquivoBatLocal( cArquivoBAT, cComando )

MsgStop('Não foi possível criar o arquivo !', 'Atenção!')

else
WaitRun(cArquivoBAT,.f.)
endif

Ferase(cArquivoBAT)

return



/******************************************************************************/
function CriaArquivoBatLocal( cArquivo, cComando )
/*
*/
local oArquivo

Ferase(cArquivo)

oArquivo := TTxtFile():Create( cArquivo )

if !oArquivo:Open()
return .f.
endif

oArquivo:add('@echo off:')
oArquivo:add(cComando)
oArquivo:Close()

return .t.
ubiratanmga@gmail.com

FWH17.04
FWPPC
Harbour/xHarbour
xMate
Pelles´C
TDolphin
Post Reply