Created
April 5, 2017 10:09
-
-
Save kmhuglen/648fd2b4bacd8a6861420fe65afe84ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
strComputer = "." | |
quote= chr(34) | |
XMLtag="<?xml version=” + quote + "1.0" + quote + " encoding=" + quote + "UTF-8" + quote + " standalone=" + quote + "yes" + quote + "?>" | |
drvold="<DRV old=" +quote | |
newdrv=quote + " new=" +quote +"Generic / Text Only" + quote + "/>" | |
Set objWMIService = GetObject("winmgmts:" & strComputer & "rootCIMV2") | |
Set colItems = objWMIService.ExecQuery( _ | |
"SELECT * FROM Win32_PrinterDriver",,48) | |
Wscript.Echo XMLtag | |
Wscript.Echo "<BrmConfig>" | |
Wscript.Echo "<DriverMap>" | |
For Each objItem in colItems | |
'Wscript.Echo "<DRV old=" "e & ExtractDriverName(objitem.Name) "e & " new=" "e & "Generic / Text Only" "e & "/>" | |
Wscript.Echo drvold & ExtractDriverName(objitem.Name) &newdrv | |
Next | |
Wscript.Echo "</DriverMap>" | |
Wscript.Echo "</BrmConfig>" | |
Wscript.Quit | |
Function ExtractDriverName(dName) | |
ExtractDriverName = Left(dName,(InStr(dName,",")-1)) | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment