ShellExecute() set as wait run

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

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
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Jack
Posts: 288
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: 140
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: 806
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.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
ShumingWang
Posts: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China
Contact:

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
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
User avatar
Enrico Maria Giordano
Posts: 8734
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 1 time
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 | Expand

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: 465
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China
Contact:

Re: ShellExecute() set as wait run

Post by ShumingWang »

With aitrun() not success , seems immediatley closed.
Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
sreerajklm
Posts: 6
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 | Expand

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

Re: ShellExecute() set as wait run

Post by ShumingWang »

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
MGA
Posts: 1254
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

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