FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ShellExecute() set as wait run
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
ShellExecute() set as wait run
Posted: Tue Oct 24, 2017 09:29 AM

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

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Re: ShellExecute() set as wait run
Posted: Tue Oct 24, 2017 10:51 AM

I think you should use WAITRUN(...)

WaitRun("notepad.exe ERROR.TXT")

Posts: 140
Joined: Thu Feb 02, 2006 12:09 PM
Re: ShellExecute() set as wait run
Posted: Tue Oct 24, 2017 10:55 AM

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
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: ShellExecute() set as wait run
Posted: Tue Oct 24, 2017 11:37 AM

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.

Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Re: ShellExecute() set as wait run
Posted: Wed Oct 25, 2017 01:48 AM

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

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: ShellExecute() set as wait run
Posted: Wed Oct 25, 2017 07:26 AM
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 (fw): Select all Collapse
WaitRun( "mysqldump --host 192.168.1.200 -u root -p   -C mydatabase>d:\back\mysqldatebas0001" )


I'm not sure about redirection, though...

EMG
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Re: ShellExecute() set as wait run
Posted: Thu Oct 26, 2017 01:59 AM

With aitrun() not success , seems immediatley closed.
Shuming Wang

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 6
Joined: Tue Sep 23, 2014 05:22 AM
Re: ShellExecute() set as wait run
Posted: Mon Oct 30, 2017 11:34 AM
Try this,

Code (fw): Select all Collapse
MsgWait("Mysql database backup","Backup",Winexec( "c:\mysql\mysqldump --host 192.168.1.200 -u root -p   -C mydatabase>d:\back\mysqldatebas0001"))
Posts: 474
Joined: Sun Oct 30, 2005 06:37 AM
Re: ShellExecute() set as wait run
Posted: Tue Oct 31, 2017 03:54 AM

Still not success , after input mysql password, seems immediatley closed.
Shuming Wang

http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Re: ShellExecute() set as wait run
Posted: Tue Oct 31, 2017 09:54 AM

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

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin

Continue the discussion