Bonjour,
Je dois installer une imprimante (HP 2420) locale sur port tcp/ip sur une 50 de poste. QQ connait un truc pour que je puisse le faire automatiquement ?
Merci.
Bonjour,
Je dois installer une imprimante (HP 2420) locale sur port tcp/ip sur une 50 de poste. QQ connait un truc pour que je puisse le faire automatiquement ?
Merci.
J'ai trouvé ca sur un autre forum:
je n'ai pas trop regarder ce batch mais tu peux essayer d'analyser un peu tout ca pour avoir qq indications.
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
46
47
48
49
50
51
52
53
54 Trouvé sur un site : @ECHO OFF VER | FIND "Windows 2000" >NUL IF ERRORLEVEL 1 GOTO Syntax SETLOCAL SET Printer=%1 SET RemotePC=%2 :: Check printer specified IF NOT DEFINED Printer GOTO Syntax IF NOT "%Printer:~0,2%"=="\\" GOTO Syntax FOR /F "tokens=1* delims=\" %%A IN ('ECHO.%Printer%') DO ( SET PrintServer=%%A Set PrintShare=%%B ) IF NOT DEFINED PrintShare GOTO Syntax PING %PrintServer% -n 1 -w 1000 2>&1 | FIND "TTL=" >NUL IF ERRORLEVEL 1 GOTO Syntax NET VIEW \\%PrintServer% 2>&1 | FIND /I "%PrintShare%" >NUL IF ERRORLEVEL 1 GOTO Syntax :: Check remote PC if specified IF DEFINED RemotePC SET RemotePC=%RemotePC:\=% IF DEFINED RemotePC ( PING %RemotePC% -n 1 -w 1000 2>&1 | FIND "TTL=" >NUL IF ERRORLEVEL 1 GOTO Syntax SET RemotePC=/C\\%RemotePC% ) :: Install the printer on the specified computer RUNDLL32.EXE PRINTUI.DLL, PrintUIEntry /ga /n%Printer% %RemotePC% IF NOT ERRORLEVEL 1 ECHO Printer installed, please reboot %RemotePC% ENDLOCAL GOTO:EOF :Syntax ECHO. ECHO AddPrint.bat, Version 1.01 for Windows 2000 ECHO Install a network printer on any PC on the network ECHO. ECHO Usage: ADDPRINT \\print_server\printer_share [ remote_pc ] ECHO. ECHO Where: "print_server" is the print server name or IP address ECHO "printer_share" is the share name for the printer ECHO "remote_pc" is the PC that will be using the ECHO network printer -- default is local PC ECHO. ECHO Written by Rob van der Woude ECHO http://www.robvanderwoude.com IF "%OS%"=="Windows_NT" ENDLOCAL
Dans ce script il s'agit de l'install d'une imprimante en passant par un serveur d'impression.
Dans le cas d'une connexion directe a l'imprimante, ca risque d'etre un peu plus compliqué puisqu'il faut aussi installer les pilotes sur chacun des postes.
Bon courage
fait une recherche sur:
rundll32 printui.dll,PrintUIEntry
Code : Sélectionner tout - Visualiser dans une fenêtre à part rundll32 printui.dll,PrintUIEntry /?
Merci,
Mais le premier script c'est pour une imprimante réseau (avec un serveur d'impression) et moi c'est une imprimante qu'on accede directement par le port tcp/ip (imprimante locale --> port tcp/ip sous windows (vachement logique, je sais ))
Et pour ton 2eme truc, je dois faire une recherche où ?
Ton idée m'a plutot interessé et après qq recherches voila ce que je viens de trouver:
https://engineering.purdue.edu/ECN/R...20040216090320
Je m'en doutais que ca ne serait pas une imprimante avec un serveur, cela aurait été trop simple ! lolEnvoyé par bilb0t
est ton amiEnvoyé par bilb0t
Envoyé par xufux
Il me semble que ça a l'air très bien !!!
Je te tiens au courant. Merci en tout cas
voici un petit script en vbs pour créer le port de l'imprimante,
il ne reste plus qu'a compléter la fin pour executer rundll32.exe printui.dll,PrintUIEntry avec les bons arguments (je n'ai pas vraiment eu le temps de me pencher sur le sujet)
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 Set WshShell = CreateObject("WScript.Shell") IP = InputBox("Entrez l'adresse IP de l'imprimante") IMP_Name = InputBox("Entrez le nom de l'imprimante") PORT_Name = "IP_" & IP REG_KEY="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\" & PORT_Name & "\" WshShell.RegWrite REG_KEY & "Protocol" ,00000001, "REG_DWORD" WshShell.RegWrite REG_KEY & "Version" , 00000001, "REG_DWORD" WshShell.RegWrite REG_KEY & "HostName" , "" WshShell.RegWrite REG_KEY & "IPAddress" , IP WshShell.RegWrite REG_KEY & "HWAddress" , "" WshShell.RegWrite REG_KEY & "PortNumber" , 9100, "REG_DWORD" WshShell.RegWrite REG_KEY & "SNMP Community" , "public" WshShell.RegWrite REG_KEY & "SNMP Enabled" , 00000001, "REG_DWORD" WshShell.RegWrite REG_KEY & "SNMP Index" , 00000001, "REG_DWORD" dim objShell set objShell = CreateObject("Shell.Application") objShell.ShellExecute "rundll32.exe", "printui.dll,PrintUIEntry ......", "", "", 1
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager