Petri.com forums Home Forums Start Page Forums Frequently Asked Questions FAQ Member List Members List
Go Back   Petri IT Knowledgebase Forums > Windows Scripting > General Scripting
Petri.com is happy to award RicklesP the title of Most Valuable Member !!!
Register Calendar Calendar Search Petri IT Knowledgebase Forums Search Todays Posts Today's Posts Mark Forums Read
Notices

simple add printer .bat script

simple add printer .bat script

this thread has 7 replies and has been viewed 206871 times

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 16th January 2006, 11:47
CRAIG CRAIG is offline
Casual
Casual
 
 Join Date: Aug 2005
  6 month star 12 month star
 Posts: 4
 Reputation: CRAIG is on a distinguished road (10)
Default simple add printer .bat script

Hi,

I need a script that will add a network printer to a users profile at login.

I can get all my mapped network drives working by using

net use T: \\server\sharename

Is there a way i can add network printers with similar code i.e.

net printer \\server\printername (does not work though)

Cheers
  #2  
Old 16th January 2006, 14:42
Dumber's Avatar
Dumber Dumber is offline
Moderator
 
 Join Date: Dec 2003
  6 month star 12 month star
 Location: The Netherlands
 Posts: 8,173
 Reputation: Dumber is a splendid one to beholdDumber is a splendid one to beholdDumber is a splendid one to beholdDumber is a splendid one to beholdDumber is a splendid one to beholdDumber is a splendid one to beholdDumber is a splendid one to behold (844)
Default Re: simple add printer .bat script

does this help you out?
http://www.google.nl/search?hl=nl&q=...er+batch&meta=
__________________
Marcel
Technical Consultant
Netherlands
http://www.phetios.com
http://blog.nessus.nl

MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
"No matter how secure, there is always the human factor."

"Enjoy life today, tomorrow may never come."
"If you're going through hell, keep going. ~Winston Churchill"

  #3  
Old 31st January 2006, 08:48
afina afina is offline
Casual
Casual
 
 Join Date: Jan 2006
  6 month star 12 month star
 Posts: 8
 Reputation: afina is on a distinguished road (10)
Default Re: simple add printer .bat script

try it with kix

?"================================================ =================="
?" installing Printers! =="
?"================================================ =================="

IF @WKSTA="nameofcomputer" OR @WKSTA="nameofcomputer1"
IF addprinterconnection("\\servername\printershare")= 0
? "Printer is installed on your computer"
ENDIF
ENDIF

Download kix at kixscripts.com
unpack it in the netlogon directory
edit the kixstart.kix or make 1 yourself
open manage users and computers
get properties of the user
go to tab profile
put in logonscript : kix32

login the workstation you have mentiont and kix will attach the printer

Last edited by afina; 31st January 2006 at 08:50..
  #4  
Old 2nd February 2006, 03:32
armstrongtj's Avatar
armstrongtj armstrongtj is offline
Casual
Casual
 
 Join Date: Dec 2005
  6 month star 12 month star
 Location: Pomona, Ca
 Posts: 22
 Reputation: armstrongtj is on a distinguished road (10)
Default Re: simple add printer .bat script

you could create a simple batch file i.e printer.bat

the batch file would look like...

START \\SERVER1\PRINTER1
START \\SERVER1\PRINTER2

--------------------------------------------------

Then you could copy this batch file to the "C:\Documents and Settings\All Users\Start Menu\Programs\Startup" folder and it will run everytime a user logs on.

Or you could copy this same batch file to a share on a server and then add a line in the logon scripts to run it.

ie example logon script

net use i: \\server1\apps
\\server1\share1\printer.bat
  #5  
Old 9th February 2006, 14:30
fastjack fastjack is offline
Casual
Casual
 
 Join Date: Jun 2005
  6 month star 12 month star
 Location: Sheffield, UK
 Posts: 11
 Reputation: fastjack is on a distinguished road (10)
Default Re: simple add printer .bat script

hi there

we have used the con2prt.exe command from the Windows resource kit. We copy a batch file and the Exe to the client PC.

The command line we use is.. con2prt.exe /cd \\server\printername

the c switch connects the printer and the d switch makes it default. We have used this on terminals where multiple users login and can use multiple printers e.g. a label printer and a report printer

FJ
  #6  
Old 9th February 2006, 18:27
topper's Avatar
topper topper is offline
Member
Someone to look up to
 
 Join Date: Apr 2005
  6 month star 12 month star
 Location: Leeds, England.
 Posts: 789
 Reputation: topper is just really nicetopper is just really nicetopper is just really nicetopper is just really nice (369)
Default Re: simple add printer .bat script

Use VB

http://forums.petri.com/showthread.php?t=6486

Just don't use the Ifmember sections.

If you already have a batch file as your login script just add the line

START \\DC\netlogon\AddPrinter.vbs

topper
__________________
* Shamelessly mentioning "Don't forget to add reputation!"
  #7  
Old 24th August 2006, 22:48
gnarbuckets gnarbuckets is offline
Casual
Casual
 
 Join Date: Aug 2006
  6 month star 12 month star
 Posts: 1
 Reputation: gnarbuckets is on a distinguished road (10)
Default Re: simple add printer .bat script

Hi.

Anyone know how to do something similar with a non-shared printer? I have a Lanier LD120, which connects directly to the LAN. And about 100 computers on which I don't want to manually install printers. Any ideas?

Lanier doesn't make an .msi package. Building one myself hasn't worked out.

Thanks!
buckets
  #8  
Old 25th August 2006, 06:44
ahinson's Avatar
ahinson ahinson is offline
Moderator
 
 Join Date: Mar 2004
  6 month star 12 month star
 Location: FL
 Posts: 1,821
 Reputation: ahinson is just really niceahinson is just really niceahinson is just really niceahinson is just really niceahinson is just really nice (440)
Default Re: simple add printer .bat script

Quote:
Originally Posted by gnarbuckets
Hi.

Anyone know how to do something similar with a non-shared printer? I have a Lanier LD120, which connects directly to the LAN. And about 100 computers on which I don't want to manually install printers. Any ideas?

Lanier doesn't make an .msi package. Building one myself hasn't worked out.

Thanks!
buckets
I'm not sure how the driver for this thing is structured but if it includes an INF you might be able to extract the driver+INF from the .msi to a share then use a batch file pointing to the share as the INF location.

Check this link out to for instructions on how-to install the driver using cmd prompt from an inf file.
http://techsupt.winbatch.com/ts/T000001031F17.html
__________________
Andrew

** Remember to give credit where credit is due and leave reputation points where appropriate **
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple script to create users in an ou downforce General Scripting 3 6th March 2006 20:32
Need help writing script to Add Printer wicks General Scripting 1 26th January 2006 14:43
Script to make local printer default? tonyyeb General Scripting 1 27th July 2005 16:16
add comp and user account for a new comp by a script avivh General Scripting 1 25th December 2004 22:33
Script to add a group to the local users/groups of xp pro roberoo General Scripting 2 30th August 2004 06:12


All times are GMT +3. The time now is 00:28.

Steel Blue 3.5.4 vBulletin Style ©2006 vBEnhanced
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
 

Valid XHTML 1.0!   Valid CSS!

Copyright 2005 Daniel Petri