[VBS] Erreur sur "AddWindowsPrinterConnection"
Bonjour,
J'essaye en vain de rajouter automatiquement une imprimante via un script VBS :
Code:
1 2 3 4 5 6 7
| Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\aval-srv\Epson_1290"
PrinterDriver = "EPSON Stylus Photo 1290"
Set rc = WshNetwork.AddWindowsPrinterConnection(PrinterPath, PrinterDriver)
If Not rc then
WScript.Echo("Échec de connexion de l'imprimante")
End If |
Mais il plante à la ligne 4 :
Code:
Set rc = WshNetwork.AddWindowsPrinterConnection(PrinterPath, PrinterDriver)
Avec le message :
Citation:
Envoyé par L'affreux script
Script : D:\Installation\VBS\Test.vbs
Ligne : 4
Caract. : 1
Erreur : Syntaxe du nom de fichier, de répertoire ou de volume incorrecte.
Code : 8007007B
Source : (null)
Et je suis completement bloqué ici.
Merci d'avance ;-)