I want to delete the most recently submitted print job with a particular document name. I will know its submission time to within a second.
I'm working in AutoIT. Invoking WMIC looks like a promising option...
...however I don't understand how date formats are handled in WMIC yet.
So, I was expecting to be able to do something like
$ReturnValue = _RunDos('WMIC Printjob WHERE (Document="ScreenPrint32 v3.5" AND TimeSubmitted > 20140404003556.000) Delete')
ConsoleWrite("$ReturnValue = " & $ReturnValue & @CRLF)
So, just working in a command prompt, the following does work if the time value is compared as an '=' and I copy and paste in the exact TimeSubmitted in quotes. ('delete' changed to 'get' for ease of testing) But I want to be able to do a time comparison of '>' and supply my own date.
WMIC Printjob WHERE (Document="ScreenPrint32 v3.5" AND TimeSubmitted = '20140404003556.912000-240') GET
Is there an easy way to identify & delete the most recent job without even messing with TimeSubmitted?
Even if I get the WMIC aspect sorted out (for which I'd be way grateful), I won't get a return value in AutoIT to know of success. (When I plug in functional WMIC printjob delete statements, the return value is always 0.) What's the best overall approach?