+ Post New Thread
Results 1 to 3 of 3
Scripts Thread, Preblem with WMI and PrintUI.dll in Coding and Web Development; I have a script which uses PrintUI.dll to add a per-machine printer. This script runs as a 'startup script', assigned ...
  1. #1
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Preblem with WMI and PrintUI.dll

    I have a script which uses PrintUI.dll to add a per-machine printer. This script runs as a 'startup script', assigned using Group Policy.

    I have another script which uses WMI to enumerate printer connections and set a default based on certain criteria. When I test the script by running it manually, it enumerates all local and network printers, including the per-machine printer added by the first script. When I assign the script as a logon script however, it does not 'see' the per-machine printer, even though it appears once the logon process is complete.

    Does anyone know of a good workaround (I can think of a few 'icky' ones)?

  2. #2

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,403
    Thank Post
    637
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    319

    Re: Preblem with WMI and PrintUI.dll

    Are they running synchronously/asynchronously? Perhaps the first one doesn't have time to finish adding it before the other one has time to enumerate them?

  3. #3
    ajbritton's Avatar
    Join Date
    Jul 2005
    Location
    Wandsworth
    Posts
    1,632
    Thank Post
    23
    Thanked 75 Times in 45 Posts
    Rep Power
    34

    Re: Preblem with WMI and PrintUI.dll

    I use Group Policy to ensure all scripts complete before the next phase (can't remember if that is synch or asynch).

    It is a good point however and I will check to ensure the first script is completing prior to user logon. Both scripts write to logs and include the date/time so I should be able to see what is happening when.

SHARE:
+ Post New Thread

Similar Threads

  1. Creating/Using 'Friendly' Printer Names With PrintUI
    By OutToLunch in forum How do you do....it?
    Replies: 1
    Last Post: 20th December 2007, 08:52 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •