En los güindos cuando instalas una impresora compartida desde otro pc se instala solo para ese perfil de usuario en ese equipo. Con estos scripts la impresora queda instalada para todos los usuarios que utilizan ese pc.Consiste en 3 scripts:

  • ImpresoraRemota.cmd
  • BorraImpresoraRemota.cmd e
  • ImpresoraDefecto.cmd

Los scripts que os muestro a continuación están preparados para que se ejecuten con modificadores todo quedará claro cuando veáis el ejemplo.

ImpresoraRemota.cmd

Este script sirve para instalar una impresora compartida en otro pc con güindos desde el pc de un administrador de la red con S.O. güindos también y remotamente. Salvar el texto siguiente en un archivo de texto y guardarlo como “ImpresoraRemota.cmd”

@Echo off
REM Este archivo de comandos añade una impresora remota en un ordenador

REM Los parámetros son:

REM 1 – El nombre del ordenador donde la impresora remota esta instalada
REM 2 – El nombre de la impresora que va a ser compartida

REM Por ejemplo, para añadir la impresora llamada “Impresora” que
REM esta compartida desde el ordenador llamado “Servidor”
REM al ordenador llamado “Cliente”:

REM Pondríamos esto en la línea de comandos:

REM ImpresoraRemota Cliente Servidor\Impresora

REM Añadir la impresora especificada, al ordenador especificado
@Echo On
rundll32 printui.dll,PrintUIEntry /ga /c\\%1 /n\\%2
@Echo off
REM Detener el “servicio spooler” en el ordenador especificado y esperar hasta que el comando sc termine
@Echo On
start /wait sc \\%1 stop spooler
@Echo off
REM Arrancar el “servicio spooler” en el ordenador especificado y esperar hasta que el comando sc termine
@Echo On
start /wait sc \\%1 start spooler

BorraImpresoraRemota.cmd

Este script sirve para desinstalar una impresora remota de un pc con güindos y para borrar la que se ha instalado con el script anterior. El script es para ejecutarlo con privilegios de administrador y remotamente. Salvar el texto siguiente en un archivo de texto y guardarlo como “BorraImpresoraRemota.cmd”

@Echo off
REM Este archivo de comandos añade una impresora remota
REM en un ordenador

REM Los parámetros son:

REM 1 – El nombre del ordenador donde la impresora remota esta instalada
REM 2 – El nombre de la impresora que va a ser compartida

REM Por ejemplo, para añadir la impresora llamada “Impresora” que esta
REM compartida desde el ordenador llamado “Servidor”
REM al ordenador llamado “Cliente”:

REM Pondríamos esto en la línea de comandos:

REM BorraImpresoraRemota Cliente Servidor\Impresora

REM Añadir la impresora especificada, al ordenador especificado
@Echo On
rundll32 printui.dll,PrintUIEntry /gd /c\\%1 /n\\%2
@Echo off
REM Detener el “print spooler” en el ordenador especificado y esperar hasta que el comando sc termine
@Echo On
start /wait sc \\%1 stop spooler
@Echo off
REM Arrancar el “print spooler” en el ordenador especificado y esperar hasta que el comando sc termine
@Echo On
start /wait sc \\%1 start spooler

ImpresoraDefecto.cmd

Este script sirve para poner una impresora por defecto para todos los usuarios que utilicen ese pc. Este script no se puede ejecutar remotamente como los anteriores. Salvar el texto siguiente en un archivo de texto y guardarlo como “ImpresoraDefecto.cmd”

@Echo off
REM Este archivo de comandos pone por defecto una impresora

REM Los parámetros son:

REM 1 – El nombre de la impresora que va a ser puesta por defecto

REM Por ejemplo, para poner por defecto la impresora llamada “Impresora”
REM que esta compartida desde el ordenador llamado “Servidor”:

REM Pondríamos esto en la línea de comandos:

REM ImpresoraDefecto Servidor\Impresora

REM Añadir la impresora especificada, al ordenador especificado
@Echo On
RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n \\%1
@Echo off

Mas comandos RUNDLL32 PRINTUI

Run server properties:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /s /t1 /n\\machine

Run printer properties:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /p /n\\machine\printer

Run add printer wizard localy:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /il

Run add printer wizard on \\machine:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /il /c\\machine

Run queue view:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /o /n\\machine\printer

Run inf install:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /b “Test Printer” /f %windir%\inf\ntprint.inf /r “lpt1:”

Run add printer wizard using inf:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /ii /f %windir%\inf\ntprint.inf

Enumerate per machine printer connections:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /ge /c\\machine

Add printer driver using inf:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /ia /c\\machine /m “AGFA-AccuSet v52.3″ /h “Intel” /v ”

Windows Remove printer driver:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /dd /c\\machine /m “AGFA-AccuSet v52.3″ /h “Intel” /v “Windows

Set printer as default:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n “printer”

Set printer comment:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xs /n “printer” comment “My Cool Printer”

Set printer port:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xs /n “printer” PortName “port:”

Get printer settings:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xg /n “printer”

Get printer settings saving results in a file:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /f “results.txt” /Xg /n “printer”

Set printer settings command usage:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Xs /n “printer” ?

Store all printer settings into a file:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /n “printer” /a “file.dat”

Restore all printer settings from a file:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n “printer” /a “file.dat”

Store printer information on level 2 into a file:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /n “printer” /a “file.dat” 2

Restore from a file printer security descriptor:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n “printer” /a “file.dat” s

Restore from a file printer global devmode and printer data:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n “printer” /a “file.dat” g d

Restore from a file minimum settings and resolve port name:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n “printer” /a “file.dat” m p


Vota este artículo:
1 Estrella2 Estrellas3 Estrellas4 Estrellas5 Estrellas (No Ratings Yet)
Loading ... Loading ...

Posts anterior y posterior: