I am attempting to "copy" PCL code to a printer in the same way that the DOS command behaves, i.e. COPY C:\MYPCLCODE \\MYSERVER\MYNETWORKPRINTER .
This command works in DOS, but my attempt at running the command in OI:
Y=Utility("RUNWIN","COPY C:\MYPCLCODE \\MYSERVER\MYNETWORKPRINTER",0)
…appears to have no effect. How to I go about performing this task from OI?
I think COPY is part of the command prompt interpreter so it cant be called directly. There is no COPY.EXE program to execute. Check the command line arguments for CMD.EXE or START.EXE. I think CMD.EXE has a /C flag so it executes a specific command, like COPY, before exiting. START.EXE might do a similar function.
SRP Utilities has a method called SRP_Run_Command that can do this for you. It automatically recognizes "built-in" commands such as COPY, IPCONFIG, etc. It also lets you reroute the output to a variable, edit box, etc. SRP Utilities is free. Feel free to download and read the accompanying help file on SRP_Run_Command.
Hi Mat,
Jared is basically right - see below for code snippet. Use what you need from this.
Simon
Command=CMD /C COPY ":Location:"TEST1.TXT "
Command := "+ ":Location:"TEST2.TXT "
Command := Location:"TEST.TXT /Y"
RetVal=UTILITY("RUNWIN",COMMAND,-1)
Thanks for the help. That did the job.