Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Printer install trough batch script Windows 7

Posted on 2011-02-11
6
Medium Priority
?
1,568 Views
Last Modified: 2012-05-11
I need a way to install a printer through a batch script or maybe a .vb script. In Windows XP i used the build in .vb scripts.

CScript prnmngr.vbs -a -p "Printer" -m "Samsung ML-2850 Series" -r "IP_172.16.0.201"
CScript prnmngr.vbs -p "Printer" -t
CScript prnqctl.vbs -e -p Printer

But in Winodws 7 i can't find an option like this. The Driver and the Port are installed, so i just need to install the Printer.

Thanks  
0
Comment
Question by:SH1986
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 

Expert Comment

by:helldesk_pit
ID: 34869776
net use \\server\printer or
net use \\printer

this will install the drivers for all users.
0
 

Author Comment

by:SH1986
ID: 34869838
The problem is that this is not a shared printer on the network, so that would not be possibility. All the printers are local network printers.
0
 

Expert Comment

by:helldesk_pit
ID: 34869971
net use \\172.16.0.201 /persistent:yes

run it as a part of your logon script.
it doesn't have to be on the server to use net use.

0
 

Author Comment

by:SH1986
ID: 34870102
Nope, does not work:

C:\Users\hor.thefirm>net use \\10.0.0.205 /persistent:yes
System error 53 has occurred.

The network path was not found.

Maybe i should tell how this is meant to be used. We are not using as a part of a logonscript, it's just a batch script we execute:

@ECHO OFF
cd %SystemRoot%\System32\
:chgerror
ECHO ......................................
ECHO          Printer Changing Menu
ECHO ......................................
ECHO.
ECHO What printer do you have?
ECHO.
ECHO 1 - HP LaserJet 1320n
ECHO 2 - HP LaserJet 2015n
ECHO 3 - HP LaserJet P2055
ECHO 4 - Samsung ML-2850 Series
ECHO 5 - Samsung CLP-310 Series
ECHO 6 - Samsung CLP-320 Series
ECHO.
SET /P P=Make your choice..:
IF %P%==1 GOTO chg1
IF %P%==2 GOTO chg2
IF %P%==3 GOTO chg3
IF %P%==4 GOTO chg4
IF %P%==5 GOTO chg5
IF %P%==6 GOTO chg6
cls
ECHO ***********ERROR IN SELECTION***********
goto chgerror
:chg1
SET prtmodel=hp LaserJet 1320 PCL 5e
GOTO chgport
:chg2
SET prtmodel=HP LaserJet P2015 Series PCL 5e
GOTO chgport
:chg3
SET prtmodel=HP LaserJet P2050 Series PCL6
GOTO chgport
:chg4
SET prtmodel=Samsung ML-2850 Series
GOTO chgport
:chg5
SET prtmodel=Samsung CLP-310 Series
GOTO chgport
:chg6
SET prtmodel=Samsung CLP-320 Series
GOTO chgport
:chgport
CLS
:conferror
ECHO ......................................
ECHO          Printer Changing Menu
ECHO ......................................
ECHO.
ECHO 1  - Will set printer to: 192.168.1.201
ECHO 2  - Will set printer to: 192.168.1.202
ECHO 3  - Will set printer to: 192.168.1.203
ECHO 4  - Will set printer to: 192.168.1.204
ECHO 5  - Will set printer to: 192.168.1.205
ECHO 6  - Will set printer to: 192.168.1.206
ECHO 7  - Will set printer to: 192.168.1.207
ECHO 8  - Will set printer to: 192.168.1.208
ECHO 9  - Will set printer to: 192.168.1.209
ECHO 10 - Will set printer to: 192.168.1.210
ECHO 11 - Will set printer to: 172.16.0.201 (Telenor)
ECHO.
SET /P M=Make your choice..:
IF %M%==1 GOTO 01
IF %M%==2 GOTO 02
IF %M%==3 GOTO 03
IF %M%==4 GOTO 04
IF %M%==5 GOTO 05
IF %M%==6 GOTO 06
IF %M%==7 GOTO 07
IF %M%==8 GOTO 08
IF %M%==9 GOTO 09
IF %M%==10 GOTO 10
IF %M%==11 GOTO 11
IF %M%==Exit GOTO Exit
cls
ECHO ***********ERROR IN SELECTION***********
goto conferror
:01
CScript prnmngr.vbs -a -p "Printer" -m "%prtmodel%" -r "IP_192.168.1.201"
GOTO Exit
:02
CScript prnmngr.vbs -a -p "Printer" -m "%prtmodel%" -r "IP_192.168.1.202"
GOTO Exit
:03
CScript prnmngr.vbs -a -p "Printer" -m "%prtmodel%" -r "IP_192.168.1.203"
GOTO Exit
:04
CScript prnmngr.vbs -a -p "Printer" -m "%prtmodel%" -r "IP_192.168.1.204"
GOTO Exit
:05
CScript prnmngr.vbs -a -p "Printer" -m "%prtmodel%" -r "IP_192.168.1.205"
GOTO Exit
:06
CScript prnmngr.vbs -a -p "Printer" -m "%prtmodel%" -r "IP_192.168.1.206"
GOTO Exit
:07
CScript prnmngr.vbs -a -p "Printer" -m "%prtmodel%" -r "IP_192.168.1.207"
GOTO Exit
:08
CScript prnmngr.vbs -a -p "Printer" -m "%prtmodel%" -r "IP_192.168.1.208"
GOTO Exit
:09
CScript prnmngr.vbs -a -p "Printer" -m "%prtmodel%" -r "IP_192.168.1.209"
GOTO Exit
:10
CScript prnmngr.vbs -a -p "Printer" -m "%prtmodel%" -r "IP_192.168.1.210"
GOTO Exit
:11
CScript prnmngr.vbs -a -p "Printer" -m "%prtmodel%" -r "IP_172.16.0.201"
:EXIT
CScript prnmngr.vbs -p "Printer" -t
cscript prnqctl.vbs -e -p Printer
cls

0
 
LVL 6

Accepted Solution

by:
RootsMan earned 1000 total points
ID: 34880837
Do you get an error when you run the command at the Command Prompt?

CScript prnmngr.vbs -a -p "Printer" -m "Samsung ML-2850 Series" -r "IP_172.16.0.201"

Open in new window


Under Windows 7, the Printing Admin .vbs Scripts are in:
C:\Windows\System32\Printing_Admin_Scripts\en-US\

Try:
cd %SystemRoot%\System32\Printing_Admin_Scripts\en-US\

Open in new window

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
OfficeMate Freezes on login or does not load after login credentials are input.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question