Initial Release Batch Version
This commit is contained in:
commit
c1383fcd0c
26 changed files with 1783 additions and 0 deletions
108
Assets/EPSON/Simple Epson SW.bat
Normal file
108
Assets/EPSON/Simple Epson SW.bat
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
@echo off
|
||||
:: Prüfe, ob Admin-Rechte vorhanden sind
|
||||
NET SESSION >nul 2>&1
|
||||
IF %ERRORLEVEL% NEQ 0 (
|
||||
echo Starte Skript mit Admin-Rechten ...
|
||||
powershell -Command "Start-Process cmd -ArgumentList '/c \"%~f0\"' -Verb RunAs"
|
||||
exit
|
||||
)
|
||||
|
||||
:: IP-Adresse eingeben
|
||||
set /p PRINTER_IP="Gib die IP-Adresse des Druckers ein: "
|
||||
|
||||
:: Druckernamen eingeben
|
||||
set /p PRINTER_NAME="Gib den Namen des Druckers ein: "
|
||||
|
||||
:: Standarddrucker-Liste setzen (SW und Farbe)
|
||||
set PRINTER_LIST="%PRINTER_NAME%"
|
||||
|
||||
:default_path
|
||||
:: Nutzt automatisch den Pfad der Batch-Datei
|
||||
set BASE_PATH=%~dp0
|
||||
set DRIVER_PATH=%BASE_PATH%Epson-treiber
|
||||
set DELETE_DRIVER_PATH=1
|
||||
echo Verwende automatisch den Treiberordner: %DRIVER_PATH%
|
||||
|
||||
:: Pruefe, ob der Treiberordner existiert
|
||||
if not exist "%DRIVER_PATH%" (
|
||||
echo Treiber nicht gefunden! Lade ihn herunter...
|
||||
|
||||
:: Treiber von HP herunterladen
|
||||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.dropbox.com/scl/fi/sxatei3to2nhd97r82dlx/Epson-Treiber.zip?rlkey=q600xpse65gvrbrxqdi8305ta&st=xvxyv84f&dl=1', '%BASE_PATH%Epson-treiber.zip')"
|
||||
|
||||
:: Pruefen, ob der Download erfolgreich war
|
||||
if not exist "%BASE_PATH%Epson-treiber.zip" (
|
||||
echo Fehler: Der Treiber konnte nicht heruntergeladen werden!
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
|
||||
echo Entpacke den Treiber...
|
||||
powershell -Command "Expand-Archive -Path '%BASE_PATH%Epson-treiber.zip' -DestinationPath '%BASE_PATH%Epson-treiber' -Force"
|
||||
|
||||
:: Pruefen, ob das Entpacken erfolgreich war
|
||||
if not exist "%BASE_PATH%Epson-treiber" (
|
||||
echo Fehler: Das Entpacken ist fehlgeschlagen!
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
|
||||
echo Entferne die ZIP-Datei...
|
||||
del "%BASE_PATH%Epson-treiber.zip"
|
||||
|
||||
echo Treiber wurde erfolgreich heruntergeladen und entpackt.
|
||||
)
|
||||
|
||||
GOTO check_path
|
||||
|
||||
:check_path
|
||||
:: Pruefe, ob der Treiberordner existiert
|
||||
if not exist "%DRIVER_PATH%" (
|
||||
echo Fehler: Der Treiberordner "%DRIVER_PATH%" existiert nicht!
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
|
||||
|
||||
:: Port erstellen
|
||||
echo Erstelle TCP/IP-Port...
|
||||
cscript "%WINDIR%\System32\Printing_Admin_Scripts\de-DE\prnport.vbs" -a -r %PRINTER_IP% -h %PRINTER_IP% -o raw
|
||||
|
||||
|
||||
:: Druckertreiber installieren (automatische INF-Suche in PCL6\64bit)
|
||||
echo Installiere Druckertreiber aus: %DRIVER_PATH%\PCL6\64bit ...
|
||||
pnputil /add-driver "%DRIVER_PATH%\Universal_Print_Driver_x64_29000\E_JFB0DE.inf" /install
|
||||
|
||||
:: Drucker installieren (inklusive der zusaetzlichen Drucker)
|
||||
for %%P in (%PRINTER_LIST%) do (
|
||||
echo Installiere Drucker: %%P ...
|
||||
rundll32 printui.dll,PrintUIEntry /if /b %%P /r "%PRINTER_IP%" /m "EPSON Universal Print Driver"
|
||||
)
|
||||
|
||||
:: Nach Installation den Registry-Wert für SW-Drucker setzen
|
||||
echo Setze Standarddrucker-Einstellungen nach OH5 Standard...
|
||||
powershell -ExecutionPolicy Bypass -File "%BASE_PATH%do_default_printersettings_mono.ps1" -PrinterName "%PRINTER_NAME%"
|
||||
|
||||
|
||||
:: Standarddrucker setzen
|
||||
set /p SET_DEFAULT="Soll '%PRINTER_NAME%' als Standard gesetzt werden? (J/N): "
|
||||
IF /I "%SET_DEFAULT%"=="J" GOTO set_default
|
||||
GOTO cleanup
|
||||
|
||||
:set_default
|
||||
rundll32 printui.dll,PrintUIEntry /y /n "%PRINTER_NAME%"
|
||||
echo "%PRINTER_NAME%" ist jetzt der Standarddrucker.
|
||||
|
||||
:cleanup
|
||||
:: Treiberordner loeschen, nur wenn der Benutzer "N" gewaehlt hat
|
||||
if "%DELETE_DRIVER_PATH%"=="1" (
|
||||
if exist "%DRIVER_PATH%" (
|
||||
echo Entferne den heruntergeladenen Treiberordner...
|
||||
rmdir /s /q "%DRIVER_PATH%"
|
||||
echo Treiberordner erfolgreich geloescht.
|
||||
)
|
||||
)
|
||||
|
||||
:end
|
||||
echo Installation abgeschlossen.
|
||||
pause
|
||||
Loading…
Add table
Add a link
Reference in a new issue