Bonjour tout le monde,

J'ai le script suivant :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Option Explicit
Dim oNetwork, sPrintPath
Set oNetwork = CreateObject("WScript.Network")
Select Case oNetwork.ComputerName
Case "SALLEINFOPC02"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC03"
   sPrintPath = "\\pharmacie\RICOHAfi"  
Case "SALLEINFOPC04"
   sPrintPath = "\\pharmacie\RICOHAfi"
  Case "SALLEINFOPC05"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC06"
     sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC07"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC08"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC09"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC10"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC11"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC12"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC13"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC14"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC15"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC16"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC17"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC18"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "SALLEINFOPC19"
   sPrintPath = "\\pharmacie\RICOHAfi"
Case "PHARMACIE"
   sPrintPath = "\\pharmacie\RICOHAfi\*.*"
End Select
oNetwork.AddWindowsPrinterConnection sPrintPath
oNetwork.SetDefaultPrinter sPrintPath
Il permet de mettre par défaut une imprimante par rapport au nom de l'ordinateur.

Le problème est sur cet ordinateur (le 19) :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
Case "SALLEINFOPC19"
   sPrintPath = "\\pharmacie\RICOHAfi"
J'obtiens un message d'erreur :

voir attaché

à la ligne 44 :

oNetwork.AddWindowsPrinterConnection sPrintPath
Sauriez-vous m'aider sur ce coup là svp car il y'a un de mes ordis en réseau que je ne peux plus utiliser pour imprimer.

Merci d'avance pour votre aide.

beegees