driver=='File') { exec("cat archivo.txt > $configuracion->destino"); } elseif ($configuracion->driver=='Cups') { exec("lp -d $configuracion->destino archivo.txt"); } elseif ($configuracion->driver=='Windows') { exec("hostname",$hostname); $hostname = $hostname[0]; //exec("print archivo.txt /d:\\\\$hostname\\$configuracion->destino"); //exec('print archivo.txt /d:\\\\'.$hostname.'\\"'.$configuracion->destino.'"'); exec('@echo %cd%',$carpeta); $carpeta = $carpeta[0]; exec('print /d:"\\\\'.$hostname.'\\'.$configuracion->destino.'" "'.$carpeta.'\archivo.txt'.'"'); } echo json_encode(array('ok'));