Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cmd.exe Issues

Status
Not open for further replies.
Apr 25, 2002
156
GB
Hello

I have a interesting issue here .... but i guess o the clever people its relatively easy but here goes.

What i am doing is looping thru a program and then shelling out to a cmd.exe window and then running the LPR command from within a batchfile to send files across our network to the laser.

Ok you might think not a problem there if i only do it once but i am wanting to do this rather a lot in a very short period of time. (about 500 times) as these files are batched AND THIS is the only to print to this laser.

My problem is that the cmd.exe window does not close or if it does it is still listed in the task window under processes - earlier today i had 114 cmd.exe windows showing as listed in the processes but in the taskbar i had none showing

What i am wanting to do is call the LPR command from within the batchfile then send the file to be printed to the laser using LPR and then exit the cmd.exe window and release the process

All the fastest possible times .... the print files are only 1mb each

any ideas ?

i have tried allsort of things

so do reply as i am stumped

regards

And thanks in advance

Murray W
 
hi there

As requested here is the batch file

rem %1% is the tcpip address to send file to (e.g. 192.9.200.1)
rem %2% is the device name (e.g. DP350Q) (not used as at 16/1/1998)
rem %3% is the spool file name from Pres (e.g. pb1234.001)
rem %4% is the file name to rename to (e.g. pb1234 Trace 1 to 50)

rem MJW mod 4/12/1997 delete long file name
del %4%

rename %3 %4

Lpr -S %1 -P %2 %4

rem pause

rem LJG mod

del %4%



This worked fine under windows 98 and since then we have upgraded to XP Pro and now the cmd.exe seems to remain open.

regards
Murray
 
Hello rdrunner40,

My knee-jerk reaction is to propose you to add the 3-line ritual at the each of the batch.
Code:
::above your code
cls
@echo off
exit
regards - tsuji
 
I mean at the [red]end[/red] of the batch.

- tsuji
 
I like Tsuji's answer, but you might consider using the Start command.

Start /LOW /B /WAIT /SHARED your batch file



 
Hi again

I thought it was a cmd.exe issue but by a process of elimination of have came to the conclusion that it might be a LPR issue.

Our OS = XP Pro

TO come to this conclusion i created a batch file which just contained the following line repeated up to 30 times .....

Lpr -S 172.31.20.4 -P MEN120 SPL12505.001

the spool file LPR's fine but after it has spooled 12 times from within the batch file it goes into a holding loop ? The size of the spoolfile is 500kb so its not a size issue.

question 1 is why does it only do 12 times and then freeze for up to 2 minutes - is there a setting to be changed somewhere ? after the 2 minutes it starts to spool again and only does another 12 and then freezes

regards

Murray

 
Have you updated your Windows Client Service for UNIX? I am curious if you have updated to the 3.5 release.
 
me again

how do i see what ver we are running ?

All updates have been done from windows update

regards

Murray
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top