Jump to content
Fivewin Brasil

Winexec nao funciona 64 bits


tramontina

Recommended Posts

tive o mesmo problema com winexec e shellExecute com Win7 64 bit e win2008R2 64bit

subistitui por ex:

cComando:= "-u root -pSENHA --all-databases > "+cDirName+"\backupD"+strtran(dtos(Date()), "/","")+"T"+Strtran(time(), ":", "")+".sql"

MsgRun( "Gerando backup, este processo poderá levar alguns minutos", "Aguarde!", { || MYRUN(oApp:cDir_001+"mysqldump "+cComando) } )

 

Function MYRUN( cComando )
Local oShell, RET

  oShell := CreateObject( "WScript.Shell" )
  RET := oShell:Run( "%comspec% /c " + cComando, 0, .T. )
  oShell := NIL

Return iif( RET = 0, .T., .F. )

 

Link to comment
Share on other sites

amigao, com sua dica acima estou tentando executar o adobe mais o windows nao esta respondendo ao comando, com esse comando acima consigo executar aplivativo tipo o adobe ?

 

segue como estou mandando o comando para a função:

 

MsgRun( 'Abrindo Arquivo PDF. Aguarde por favor...','Aguarde ',{|| ExecWin(_adobe+'acrord32.exe '+_decript+'\'+cProcdec+'.pdf') } )
 

o objeto oapp deu erro ao compilar, por isso que tirei.

Link to comment
Share on other sites

consegui solucionar...

 

MsgRun( 'Abrindo Arquivo PDF. Aguarde por favor...','Aguarde ',{|| ExecWin('acrord32.exe '+_decript+'\'+cProcdec+'.pdf') } )

 

Function ExecWIN( cComando )
Local oShell, RET

  oShell := CreateObject( "WScript.Shell" )
  RET := oShell:Run( cComando, 0, .T. )
  oShell := NIL

Return iif( RET = 0, .T., .F. )

E agradeço muito a dica acima, foi porreta.

 

Emerson

Link to comment
Share on other sites

Simplesmente substituí a função nativa por essa ( com o mesmo nome ) e está tudo funcionando.

 

******************************************************************************

Function WinExec( cComando ) // Essa função substitui o WinExec() para Win64 bits

******************************************************************************

// Versão.: Incluída em 12-04-2013 no OASyS.

// Exemplo: MsgRun('Abrindo Arquivo PDF. Aguarde por favor...','Aguarde ',;

//                 {|| WinExec('acrord32.exe '+_decript+'\'+cProcdec+'.pdf')})

Local oShell, nRet

   oShell := CreateObject( "WScript.Shell" )

   nRet   := oShell:Run( cComando, 0, .T. )

   oShell := NIL

Return iif(nRet=0, .T., .F.)

Link to comment
Share on other sites

boa tarde pessoal

 

testei o WinExec e ShellExecute com Win 8 e Win 7, ambos 64 bits e funcionou ok, 100 %

 

vejam:

 

cComand:='RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8'
nRet:=WinExec(cComand) 
? nRet

cArquivo:='Teste.TXT'
cComand:='Notepad '+cArquivo
nRet:=WinExec(cComand)
? nRet

cComand:='www.google.com.br'
nRet:=ShellExecute(GetActiveWindow(),"open",'"'+cComand+'"')
? nRet

 

 


 

 

será q existe mesmo essa limitação ?

 

abraço

Yury

xHB build 1.1.0 (SimpLex) & BCC 5.5.1 & FW 8.01

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...