Hello All!
I am currently trying to write a batch file to install printers in our small office.
The problem I am running into is I want only specific lines visible to users.
below is what i have so far. Everything in Dark Blue I want the users to see everything else can be hidden.
I don't really want to use a .vbs script and Powershell is currently not an option for my office. any suggestions would be helpful
Thanks
:Menu
cls
[color=#FFFF00]@echo Choose a Paw Paw Printer to install
@echo 1) Install Black and White Ricoh Printer
@echo 2) Install Xerox Color Printer
@echo 3) Install All Printers
@echo 4) Exit
[/color]
@echo.
@echo After installing printers this file will self destruct!
@echo.
set /p op= Choose your Printer:
if {%op%}=={1} (goto :print1)
if {%op%}=={2} (goto :print2)
if {%op%}=={3} (goto :print3)
if {%op%}=={4} (goto :exit)
@echo.
:print1
[color=#0000FF]
@echo.
@echo *Kinexus*
@echo
@echo This will Install the Ricoh Black and White printer on your computer.
@echo Once you click OK, it will run. It may take a minute to install.
@echo During that time you will see no screen activity until it finishes.
@echo Installing Printer.... please wait
@echo.
@echo [/color]
cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnport.vbs -a -r IP_192.168.144.80 -h 192.168.144.80 -o raw -n 9100
rundll32 printui.dll,PrintUIEntry /ia /m "Ricoh Aficio MP 6000 PCL" /F "\\bh-miworks-srv2\PrintDrivers\Drivers\RICOH Aficio MP 6002 PCL\oemsetup.inf"
rundll32 printui.dll,PrintUIEntry /if /b "BH Paw Paw Black and White" /F "\\bh-miworks-srv2\PrintDrivers\Drivers\RICOH Aficio MP 6002 PCL\oemsetup.inf" /r "IP_192.168.144.80" /m "Ricoh Aficio MP 6000 PCL"
@echo.
@echo *Kinexus*
@ECHO Installation of the Ricoh Black and White printer has completed!
@echo If you have any problems, please contact IT.
@echo.
pause
goto Menu
:print2
@echo *Kinexus*
@echo.
@echo This will Install the Xerox Color printer on your computer.
@echo Once you click OK, it will run. It may take a minute to install.
@echo During that time you will see no screen activity until it finishes.
@echo Installing Printer.... please wait
@echo.
cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnport.vbs -a -r IP_192.168.144.75 -h 192.168.144.75 -o raw -n 9100
rundll32 printui.dll,PrintUIEntry /ia /m "Xerox Phaser 6180N PCL 6" /F "\\bh-miworks-srv2\PrintDrivers\Drivers\Xerox6180N\64Bit\xrxkrzi.inf"
rundll32 printui.dll,PrintUIEntry /if /b "Paw Paw Color" /F "\\bh-miworks-srv2\PrintDrivers\Drivers\Xerox6180N\64Bit\xrxkrzi.inf" /r "IP_192.168.144.75" /m "Xerox Phaser 6180N PCL 6"
@echo.
@echo *Kinexus*
@ECHO Installation of the Xerox Color printer has completed!
@echo If you have any problems, please contact IT.
@echo.
pause
goto Menu
:print3
@echo *Kinexus*
@echo.
@echo This will Install all Paw Paw printers on your computer.
@echo Once you click OK, it will run. It may take a minute to install.
@echo During that time you will see no screen activity until it finishes.
@echo Installing Printer.... please wait
@echo.
cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnport.vbs -a -r IP_192.168.144.80 -h 192.168.144.80 -o raw -n 9100
rundll32 printui.dll,PrintUIEntry /ia /m "Ricoh Aficio MP 6000 PCL" /F "\\bh-miworks-srv2\PrintDrivers\Drivers\RICOH Aficio MP 6002 PCL\oemsetup.inf"
rundll32 printui.dll,PrintUIEntry /if /b "BH Paw Paw Black and White" /F "\\bh-miworks-srv2\PrintDrivers\Drivers\RICOH Aficio MP 6002 PCL\oemsetup.inf" /r "IP_192.168.144.80" /m "Ricoh Aficio MP 6000 PCL"
cscript %WINDIR%\System32\Printing_Admin_Scripts\en-US\Prnport.vbs -a -r IP_192.168.144.75 -h 192.168.144.75 -o raw -n 9100
rundll32 printui.dll,PrintUIEntry /ia /m "Xerox Phaser 6180N PCL 6" /F "\\bh-miworks-srv2\PrintDrivers\Drivers\Xerox6180N\64Bit\xrxkrzi.inf"
rundll32 printui.dll,PrintUIEntry /if /b "Paw Paw Color" /F "\\bh-miworks-srv2\PrintDrivers\Drivers\Xerox6180N\64Bit\xrxkrzi.inf" /r "IP_192.168.144.75" /m "Xerox Phaser 6180N PCL 6"
@echo.
@echo *Kinexus*
@ECHO Installation of both Xerox & Ricoh printes has completed!
@echo If you have any problems, please contact IT.
@echo.
pause
goto Menu
:exit
exit
How to Hide Specific Lines in a Batch File
Moderator: DosItHelp
-
- Posts: 24
- Joined: 06 May 2014 09:55
- Location: North West Indiana
Re: How to Hide Specific Lines in a Batch File
Can I ask what is seen at the moment? Only the information in the echo commands?
If you place a rem before every echo command you want to disable, then they will be invisible. This assumes you have @echo off as the first line.
rem @echo line here
If you place a rem before every echo command you want to disable, then they will be invisible. This assumes you have @echo off as the first line.
rem @echo line here
-
- Posts: 24
- Joined: 06 May 2014 09:55
- Location: North West Indiana
Re: How to Hide Specific Lines in a Batch File
Thanks I will give it a shot and let you know how it works
-
- Posts: 24
- Joined: 06 May 2014 09:55
- Location: North West Indiana
Re: How to Hide Specific Lines in a Batch File
so far everything is shown.
as it runs I can see all the processes of adding printer,
and just about all the commands that make this script happen.
If I knew how I would show a screenshot on this fourm.
as it runs I can see all the processes of adding printer,
and just about all the commands that make this script happen.
If I knew how I would show a screenshot on this fourm.
-
- Posts: 24
- Joined: 06 May 2014 09:55
- Location: North West Indiana
Re: How to Hide Specific Lines in a Batch File
using rem @echo on say line set /p op= Choose your Printer:
disables the choice and just installs the printers. not quite what i'm looking for.
Thanks in advance for any help
disables the choice and just installs the printers. not quite what i'm looking for.
Thanks in advance for any help
Re: How to Hide Specific Lines in a Batch File
foxidrive wrote:This assumes you have @echo off as the first line.
Let me put it this way, in case wchristner missed it. Try it with the above change.
-
- Posts: 24
- Joined: 06 May 2014 09:55
- Location: North West Indiana
Re: How to Hide Specific Lines in a Batch File
Wow I feel Silly you are correct sir. Thank you
it looks much better.
thanks again
it looks much better.
thanks again