ShellExecute() set as wait run

ShellExecute() set as wait run

Postby ShumingWang » Tue Oct 24, 2017 9: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
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: ShellExecute() set as wait run

Postby Jack » Tue Oct 24, 2017 10:51 am

I think you should use WAITRUN(...)

WaitRun("notepad.exe ERROR.TXT")
Jack
 
Posts: 280
Joined: Wed Jul 11, 2007 11:06 am

Re: ShellExecute() set as wait run

Postby mag071 » 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
User avatar
mag071
 
Posts: 140
Joined: Thu Feb 02, 2006 12:09 pm
Location: Venezuela

Re: ShellExecute() set as wait run

Postby richard-service » 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 (r2402101027) => Borland C++ v7.7 32bit
MySQL v5.7 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 764
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: ShellExecute() set as wait run

Postby ShumingWang » Wed Oct 25, 2017 1: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
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: ShellExecute() set as wait run

Postby Enrico Maria Giordano » Wed Oct 25, 2017 7: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: Select all  Expand view
WaitRun( "mysqldump --host 192.168.1.200 -u root -p   -C mydatabase>d:\back\mysqldatebas0001" )


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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: ShellExecute() set as wait run

Postby ShumingWang » Thu Oct 26, 2017 1: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
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: ShellExecute() set as wait run

Postby sreerajklm » Mon Oct 30, 2017 11:34 am

Try this,

Code: Select all  Expand view
MsgWait("Mysql database backup","Backup",Winexec( "c:\mysql\mysqldump --host 192.168.1.200 -u root -p   -C mydatabase>d:\back\mysqldatebas0001"))
sreerajklm
 
Posts: 6
Joined: Tue Sep 23, 2014 5:22 am
Location: Kochi, India

Re: ShellExecute() set as wait run

Postby ShumingWang » Tue Oct 31, 2017 3: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
ShumingWang
 
Posts: 460
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: ShellExecute() set as wait run

Postby MGA » Tue Oct 31, 2017 9: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

FWH18.02
FWPPC
Harbour/xHarbour
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1234
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests