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,077 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
Learn about cloud computing and its benefits for small business owners.
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now