prndrvr.vbs "Generic Failure"

Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.windowsxp.print_fax (More info?)

Hi All,

I'm using prndrvr.vbs to remove old printer drivers from remote PCs.
I've tested it from a command line and it works perfectly, and new drivers
are automatically installed.
The problem is that when I run a vb script which in turn calls prndrvr.vbs,
I get the following error:

"Unable to delete printer driver HP LaserJet 5M Error 0x80041001 Generic
failure"

The code that calls prndrvr looks like this:

wshShell.Run "%COMSPEC% /c cscript.exe c:\windows\system32\prndrvr.vbs -d -m
" _
& Chr(34) & "HP LaserJet 5M" & Chr(34) & " -v 3 -e " & Chr(34)_
& "Windows NT x86" & Chr(34) & " -s " & strComputer & ">" & TempFile, 0,
True

Can I run prndrvr from within another vb script to delete printers?
Is there an easier way to do this?

Cheers,
Mark
1 answer Last reply
More about prndrvr generic failure
  1. Archived from groups: microsoft.public.scripting.vbscript,microsoft.public.windowsxp.print_fax (More info?)

    Hi All,

    I accidentally sorted this out for myself.
    I had another function in the script which restarted the spooler service
    before the drivers were deleted. The prndrvr was being called before the
    spooler had fully restarted.

    Cheers,
    Mark

    "Mark Feodoroff" <markf@qimr.edu.au> wrote in message
    news:el2gFYWbFHA.616@TK2MSFTNGP12.phx.gbl...
    > Hi All,
    >
    > I'm using prndrvr.vbs to remove old printer drivers from remote PCs.
    > I've tested it from a command line and it works perfectly, and new drivers
    > are automatically installed.
    > The problem is that when I run a vb script which in turn calls
    > prndrvr.vbs, I get the following error:
    >
    > "Unable to delete printer driver HP LaserJet 5M Error 0x80041001 Generic
    > failure"
    >
    > The code that calls prndrvr looks like this:
    >
    > wshShell.Run "%COMSPEC% /c cscript.exe
    > c:\windows\system32\prndrvr.vbs -d -m " _
    > & Chr(34) & "HP LaserJet 5M" & Chr(34) & " -v 3 -e " & Chr(34)_
    > & "Windows NT x86" & Chr(34) & " -s " & strComputer & ">" & TempFile, 0,
    > True
    >
    > Can I run prndrvr from within another vb script to delete printers?
    > Is there an easier way to do this?
    >
    > Cheers,
    > Mark
    >
Ask a new question

Read More

VBS Microsoft Windows XP