Jump to content

Printer Silent Installation


Recommended Posts


Posted

hier die Lösung :

:: __________________________________________________________________

::

:: Batch Script: Printer.cmd

:: Author: Frank Schulze

::

::

:: Built/Tested On: Windows XP

::

:: Purpose: installiert HPLJ2100 Treiber und TCP/IP Port

:: wird von "RunOnceEx" in der Registry gestartet

::

:: Syntax: Printer.cmd YES (Parameter optional, wenn OK dann installieren)

::

:: Last Update: 2006-01-27

:: __________________________________________________________________

@echo off

color 8f

REM color 0e

REM cmdow @ /HID

cmdow @ /MOV 240 20 /SIZ 500 250

cls

SET TITEL=HPLJ2100 an TCP/IP-Port installieren ...

IF NOT DEFINED LOGFILE SET LOGFILE="%Systemdrive%\tHe-sHokOPoweR.log" >nul

TITLE %TITEL%

call:SUB1

REM ins aktuelle Verzeichnis wechseln

%~d0

cd "%~dp0"

REM die DLL aus dem Recourcekit registrieren, sie Datei muss in $OEM$\$$\System32 stehen dann wird sie autom. kopiert

echo ¯ registriere Prnadmin.dll .... |mtee /+ %LOGFILE%

START /wait regsvr32 /s %WINDIR%\System32\Prnadmin.dll >>%LOGFILE% 2>&1

ping -n 2 127.0.0.1 >nul

REM löscht den Drucker falls vorhanden

echo ¯ loesche evtl. vorhandenen Drucker .... |mtee /+ %LOGFILE%

START /wait rundll32 printui.dll,PrintUIEntry /q /dl /n "HPLJ 2100 Netz" >>%LOGFILE% 2>&1

ping -n 2 127.0.0.1 >nul

REM Eine VBS Datei erstellen die den Printerport erzeugt

ECHO >"%Temp%\printer.vbs" Set WshShell = Wscript.CreateObject("Wscript.Shell")

ECHO.>>"%Temp%\printer.vbs"

ECHO >>"%Temp%\printer.vbs" const kTcpRaw = 1

ECHO >>"%Temp%\printer.vbs" const kTcpLPr = 2

ECHO >>"%Temp%\printer.vbs" const kLocal = 3

ECHO >>"%Temp%\printer.vbs" const kLocalDownLevel = 4

ECHO >>"%Temp%\printer.vbs" const kLprMon = 5

ECHO >>"%Temp%\printer.vbs" const kHPdlc = 7

ECHO >>"%Temp%\printer.vbs" const kUnknown = 8

ECHO.>>"%Temp%\printer.vbs"

ECHO >>"%Temp%\printer.vbs" const kStdTCPIP = "Standard TCP/IP Port"

ECHO.>>"%Temp%\printer.vbs"

ECHO >>"%Temp%\printer.vbs" dim oPort

ECHO.>>"%Temp%\printer.vbs"

ECHO >>"%Temp%\printer.vbs" dim oMaster

ECHO.>>"%Temp%\printer.vbs"

ECHO >>"%Temp%\printer.vbs" set oPort = CreateObject("Port.Port.1")

ECHO.>>"%Temp%\printer.vbs"

ECHO >>"%Temp%\printer.vbs" set oMaster = CreateObject("PrintMaster.PrintMaster.1")

ECHO.>>"%Temp%\printer.vbs"

ECHO.>>"%Temp%\printer.vbs"

ECHO >>"%Temp%\printer.vbs" On Error Resume Next

ECHO.>>"%Temp%\printer.vbs"

ECHO >>"%Temp%\printer.vbs" oPort.ServerName = ""

ECHO >>"%Temp%\printer.vbs" oPort.PortName = "HPLJ2100 (192.168.122.90)"

ECHO.>>"%Temp%\printer.vbs"

ECHO >>"%Temp%\printer.vbs" oMaster.PortDel oPort

ECHO.>>"%Temp%\printer.vbs"

ECHO >>"%Temp%\printer.vbs" On Error GoTo 0

ECHO.>>"%Temp%\printer.vbs"

ECHO >>"%Temp%\printer.vbs" oPort.PortName = "HPLJ2100 (192.168.122.90)"

ECHO >>"%Temp%\printer.vbs" oPort.SNMPDeviceIndex = "1"

ECHO >>"%Temp%\printer.vbs" oPort.CommunityName = "public"

ECHO >>"%Temp%\printer.vbs" oPort.HostAddress = "192.168.122.90"

ECHO >>"%Temp%\printer.vbs" oPort.QueueName = 9100

ECHO >>"%Temp%\printer.vbs" oPort.PortType = kTcpRaw

ECHO.>>"%Temp%\printer.vbs"

ECHO >>"%Temp%\printer.vbs" oMaster.PortAdd oPort

ECHO.>>"%Temp%\printer.vbs"

call:SUB1

REM mit dem VBS Scrpit den Printerport erstellen

echo ¯ erstelle den TCP/IP Port .... |mtee /+ %LOGFILE%

start /wait wscript.exe "%Temp%\printer.vbs" >>%LOGFILE% 2>&1

ping -n 2 127.0.0.1 >nul

REM den Drucker erstellen

echo ¯ HPLJ 2100 einrichten .... |mtee /+ %LOGFILE%

START /wait rundll32 printui.dll,PrintUIEntry /if /b "HPLJ 2100 Netz" /f "%~dp0Driver\HP212IP6.INF" /r "HPLJ2100 (192.168.122.90)" /m "HP LaserJet 2100 Series PCL 6" /z >>%LOGFILE% 2>&1

ping -n 2 127.0.0.1 >nul

REM Richtet den Drucker als Standarddrucker ein:

echo ¯ HPLJ 2100 als Standarddrucker .... |mtee /+ %LOGFILE%

START /wait rundll32 printui.dll,PrintUIEntry /y /n "HPLJ 2100 Netz" >>%LOGFILE% 2>&1

ping -n 2 127.0.0.1 >nul

REM Richtet einen Kommentar zum Drucker ein:

echo ¯ HPLJ 2100 Beschreibung einrichten .... |mtee /+ %LOGFILE%

START /wait rundll32 printui.dll,PrintUIEntry /Xs /n "HPLJ 2100 Netz" Comment "der coole SW-Laser vom Chef" >>%LOGFILE% 2>&1

ping -n 2 127.0.0.1 >nul

REM Druckt eine Testseite auf dem angegebenen Drucker aus. Kann bei der Druckerinstallation nicht verwendet werden.

echo ¯ HPLJ 2100 Testseite drucken .... |mtee /+ %LOGFILE%

START /wait rundll32 printui.dll,PrintUIEntry /k /n "HPLJ 2100 Netz" >>%LOGFILE% 2>&1

ping -n 2 127.0.0.1 >nul

REM Link für Adminseite einrichten

echo ¯ HPLJ 2100 Administration einrichten .... |mtee /+ %LOGFILE%

SET STARTMENUSYS=%ALLUSERSPROFILE%\Startmen\System\Powertoys

copy /Y "%~dp0HP-Administration.url" "%STARTMENUSYS%" >>%LOGFILE% 2>&1

ping -n 2 127.0.0.1 >nul

call:SUB1

echo ¯ temp. Dateien loeschen ....

DEL /s /f /q "%Temp%\printer.vbs" >>%LOGFILE% 2>&1

ping -n 2 127.0.0.1 >nul

echo ¯ Druckerinstallation fertig .... |mtee /+ %LOGFILE%

echo. |mtee /+ %LOGFILE%

echo. |mtee /+ %LOGFILE%

ping -n 3 127.0.0.1 >nul

EXIT

GOTO :EOF

:SUB1

cls

echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» |mtee /+ %LOGFILE%

echo º º

echo º HPLJ 2100 by tHe sHokOPoweR º |mtee /+ %LOGFILE%

echo º º

echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ |mtee /+ %LOGFILE%

echo.

echo File: %~n0%~x0

echo.

GOTO :EOF

EXIT

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...