gibaf Posted March 7, 2008 Report Share Posted March 7, 2008 Estou precisando executar um comando do MS-DOS, e estou usando o WinExec(...) mas nao esta executando, mesmo nao dando erro. O meu windows eh xp/07, e quero executar tipo do "copy origem destino" ! Se alguem puder ajudar, fico muito agradecido: MUITO OBRIGADO !! Gilberto Frohlich - Toledo/PR giba_f@hotmail.com giba_f@yahoo.com.br xHarbour Comercial xBuild Mar_06+Fivewin 2.7+PellesC+(Postgres+DB2) Quote Link to comment Share on other sites More sharing options...
gibaf Posted March 7, 2008 Author Report Share Posted March 7, 2008 Estou precisando executar um comando do MS-DOS, e estou usando o WinExec(...) mas nao esta executando, mesmo nao dando erro. O meu windows eh xp/07, e quero executar tipo do "copy origem destino" ! Se alguem puder ajudar, fico muito agradecido: MUITO OBRIGADO !! Gilberto Frohlich - Toledo/PR giba_f@hotmail.com giba_f@yahoo.com.br xHarbour Comercial xBuild Mar_06+Fivewin 2.7+PellesC+(Postgres+DB2) Quote Link to comment Share on other sites More sharing options...
toya Posted March 7, 2008 Report Share Posted March 7, 2008 Eu utilizo assim: ... win_exec( 'copy mfpc52.ini mp_pc52.ini' ) ... //////////////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////////////////// function Win_exec( cComando ) local cExecute:=GetEnv( 'COMSPEC' ) + ' /C ' if WinExec( 'start '+alltrim( cComando ), 0 ) < 32 // Tenta executar com START, se retorno < 32 WinExec( cExecute+alltrim( cComando ), 0 ) // é Win 2000 ou superior, executa com CMD.EXE endif return nil '> ... win_exec( 'copy mfpc52.ini mp_pc52.ini' ) ... //////////////////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////////////////// function Win_exec( cComando ) local cExecute:=GetEnv( 'COMSPEC' ) + ' /C ' if WinExec( 'start '+alltrim( cComando ), 0 ) < 32 // Tenta executar com START, se retorno < 32 WinExec( cExecute+alltrim( cComando ), 0 ) // é Win 2000 ou superior, executa com CMD.EXE endif return nil toya (Ahora en la version 5.8) toyasis@yahoo.com.br http://www.toyanet.com.br FWH 2.6+PellesC+xHarbour.org 0.99 - MySql 5.0.12 Beta - SqlLib - Rpv FW 2.4+WS 4.5+Blinker 7.0+Clipper 5.2E+Rpv Linux 2.4.29 - Slack 10.1 - (No@Say) Quote Link to comment Share on other sites More sharing options...
Kbelo Posted March 7, 2008 Report Share Posted March 7, 2008 citação:Estou precisando executar um comando do MS-DOS, e estou usando o WinExec(...) mas nao esta executando, mesmo nao dando erro. O meu windows eh xp/07, e quero executar tipo do "copy origem destino" ! Se alguem puder ajudar, fico muito agradecido: MUITO OBRIGADO !! Gilberto Frohlich - Toledo/PR giba_f@hotmail.com giba_f@yahoo.com.br xHarbour Comercial xBuild Mar_06+Fivewin 2.7+PellesC+(Postgres+DB2) id=quote>id=quote>se for só o copy vc pode usar o Copy file arq1 to arq2 id=code>id=code>Marcelo Michels marcelo@infototal.com.br celo.michels@hotmail.com xHarbour 1.1 + Fwh 8.01 + WorkShop + Bcc 5.82 + WvwTools + SQLRDD + xMate. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.