LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I tell when a print job has finished

I'm using Labview to launch an external application and a script within that application to open and print a document to a network printer. I'm doing this several times in succession using a loop in my VI. The problem is that If I send the next value to the external application before the previous document has finished printing, the external app gives me an error. I'd like to somehow determine that the print task has completed before sending the next value. Any help would be greatly appreciated.
0 Kudos
Message 1 of 3
(3,304 Views)

Try this thread for some ideas.

http://forums.ni.com/ni/board/message?board.id=170&message.id=177367&query.id=10992#M177367

You could use a command prompt and some DOS commands to look at queue status, or you could use .vbs scripts.

http://www.microsoft.com/technet/scriptcenter/scripts/printing/servers/default.mspx

0 Kudos
Message 2 of 3
(3,300 Views)

You should be able to use prnjobs.vbs

Remarks

This command starts a script that is located in the systemroot\system32 directory. You must type this command at a command prompt with that directory as the current directory, or you must type the full path to that directory at the beginning of the cscript command.

To display a list of print jobs and their ID numbers, use this command with the -l parameter.

If the information that you supply contains spaces, use quotation marks around the text (for example, "Computer Name").

To list the print jobs in a print queue

Syntax

cscript prnjobs -l [-s RemoteComputer] [-p PrinterName] [-u UserName -w Password]

Parameters

-l : Required. Specifies that you want to list all the print jobs in a print queue.

-s RemoteComputer : Specifies, by name, the remote computer that hosts the print queue whose jobs you want to list. If you do not specify a computer, the local computer is used.

-p PrinterName : Specifies, by name, the printer whose print queue contains the jobs you want to list. If you do not specify a printer, then all jobs in all print queues are listed.

-u UserName -w Password : Specifies an account with permissions to connect by using Windows Management Instrumentation (WMI) services to the computer that hosts the print queue whose jobs you want to list. All members of the Administrators group for that computer have these permissions, but the permissions can also be granted to other users. If you do not specify an account, you must be logged on under an account with these permissions for the command to work. For more information on WMI, see Related Topics.

/?: Displays help at the command prompt.

0 Kudos
Message 3 of 3
(3,297 Views)