2

Possible Duplicate:
How to get the original full file path been printed by Spooler API

try
{
    ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2","SELECT * FROM Win32_PrintJob");
}

foreach (ManagementObject queryObj in searcher.Get())
{
    Console.WriteLine("Document: {0}", queryObj["Document"]);
}

This gives the document name, I need the location of the file.

Community
  • 1
  • 1
bewithyou
  • 27
  • 1
  • 5

1 Answers1

0

Once the document is passed to the spooler, it will not have any reference to this information. See here for info on what fields are stored in Win32_PrintJob

Rob Hardy
  • 1,821
  • 15
  • 15