NO meu caso eu executo:
Código: Selecionar todos
comanda := "dosprint.exe /SEL TLTERM1.txt"
run (comanda)
Tem como evitar a telinha preta ??
Moderador: Moderadores

Código: Selecionar todos
comanda := "dosprint.exe /SEL TLTERM1.txt"
run (comanda)
Código: Selecionar todos
comanda := "Start /B dosprint.exe /SEL TLTERM1.txt"
Código: Selecionar todos
FUNC MYRUN( cComando, lWait ) // executa programa externo com parâmetros
Local oShell, ret
lWait := If( Empty( lWait ), .F., lWait ) // Se .T. aguarda o programa fechar, se .F. não aguarda...
oShell := CreateObject( "WScript.Shell" )
ret := oShell:Run( "%comspec% /c " + cComando, 0, lWait )
oShell := Nil
Return If( ret = 0, .T., .F. )




Código: Selecionar todos
DO CASE
CASE (nAnchoHoja = 080); cCpi:= ' /CPI10'
CASE (nAnchoHoja = 132); cCpi:= ' /CPI17'
CASE (nAnchoHoja > 132); cCpi:= ' /CPI22'
ENDCASE
//
// cCpi == Caracteres por pulgada
//
cRtf := ' /PDF' // Genera PDF
cLuc := ' /LUC' // Fuente Lucida Console
cHoriz:= ' /LAND' // Para impresion Horizontal
//
cParametros:= (cCpi + ' /CP850 /TOP0.5 /DELAY0' ;
+ cRtf + cLuc + cHoriz + ' ' + cArchTxt)
//
// DELAY0 es para que DosPrinter libere el sistema
// antes de terminar de imprimir
// cArchTxt = Archivo de texto
//
cComando:= ('D:\MiCarpeta\DosPrinter.EXE' + cParametros)
RunCmd(cComando)
RETURN NIL
...
FUNCTION RunCmd(cComando)
LOCAL oShell:= CreateObject('WScript.Shell')
//
oShell:Run('%comspec% /c ' + cComando, 0, .T.)
RETURN NIL

Código: Selecionar todos
oShell: Run ('%comspec% /c' + cComando, 0, .T.)Código: Selecionar todos
oShell: Run ('start %comspec% /c' + cComando, 0, .T.)Subsystem Call ....: WScript.Shell
System Code .......: 3
Default Status ....: .F.
Description .......: DISP_E_MEMBERNOTFOUND
Operation .........: RUN
Arguments .........: [ 1] = Type: C Val: start %comspec% /c calc.exe [ 2] = Type: N Val: 0 [ 3] = Type: L Val: .T.
Involved File .....:
Dos Error Code ....: 0


Já falado em outros tópicos.Mário Isa escreveu:pero ha falladosegue o erro Subsystem Call ....: WScript.ShellSystem Code .......: 3Default Status ....: .F.Description .......: DISP_E_MEMBERNOTFOUNDOperation .........: RUNArguments .........: [ 1] = Type: C Val: start %comspec% /c calc.exe [ 2] = Type: N Val: 0 [ 3] = Type: L Val: .T.Involved File .....: Dos Error Code ....: 0