Solved

Script with Net Use LPT1 command to go to a machine specific path through GPO distribution - any ideas?

Posted on 2006-11-28
5
1,094 Views
Last Modified: 2010-05-18
Here's another one guys, I hope someone can help :)

I'm completely familiar with the NET USE command for setting up mapped folders and redirected LPT ports.

I have a more specific request though. Could anyone tell me if there is any syntax I can use within a line that redirects the LPT port to a location based on the specific users machine name? As an example, I want the machine 'JOHN-SMITH' to do the following:

NET USE LPT1 \\JOHN-SMITH\HPPRINTER\

But I don't want to have to do it for each user manually in this way. I want to roll out a GPO that will do something to the effect of:

NET USE LPT1 \\USERSMACHINE\HPPRINTER\

So that when the system logs in and gets the script from the GPO, it automatically maps the LPT port having read the user machine name. I hope this makes sense. Perhaps some kind person could advise?

Many thanks,

Bluemercury
0
Comment
Question by:bluemercury
  • 3
5 Comments
 
LVL 14

Accepted Solution

by:
canali earned 500 total points
ID: 18032521
@echo off
::mapLPT.cmd
::
net use LPT1 \\%COMPUTERNAME%\HPPRINTER
:: bye Gastone
0
 
LVL 1

Author Comment

by:bluemercury
ID: 18059628
Thanks you so much for posting this - couldn't find it anywhere on the web! I ended up using the net use command on each computer locally in the end as i was desperate to get things working. In the next few weeks there are going to be some new machines joining the network though, and as they do I'll try using your suggestion via a GPO. I'll come back to let you know if it works, and award points once I've had a chance to impement it.

Thanks so much for your help.

Best wishes,

Bluemercury
0
 
LVL 1

Author Comment

by:bluemercury
ID: 18389784
I'd like to still try out the user's solution - I suspect it will work, and if so he deserves the credit for having advised it. I have yet to be able to test it in our working environment. I'm due to reimplement the whole network at my work place in the next 3 weeks though, so could you leave it open that long? I promise to come back and respond within 21 days :)

Bluemercury
0
 
LVL 1

Author Comment

by:bluemercury
ID: 18670330
Ok, it took a little longer than 3 weeks (lots of Server problems at work) but I've finally been able to try out your Net Use suggestion. It worked fantastically, and speed up the process of distrbuting DOS printer maps using a GPO no end! Thanks so much for your help - class A advice, and I will award the points immediately.

Many thanks,

Bluemercury
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

829 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