leiw Posted September 26, 2006 Report Share Posted September 26, 2006 I want all user only map to in room printer, so they cannot map to another room printer.Below is my script but still failure...@echo offnet use y: \\file\ftp\%username%net use x: \\file\publicif %computername%==office4 goto office:officerundll32 PrintUI.dll,PrintUIEntry /in /n \\file\lp01goto end:endThank ! Quote Link to comment Share on other sites More sharing options...
leiw Posted September 27, 2006 Author Report Share Posted September 27, 2006 Anyone can help me ?Thank Quote Link to comment Share on other sites More sharing options...
ɹəuəllıʍ ʇɐb Posted September 27, 2006 Report Share Posted September 27, 2006 Hello, welcome to the Windows Forum, and sorry that you didn't get a reply yet.Problem is that not too many people here are familiar with DOS scripting, including myself. However, let's try to find a solution.You say "still failure"; can you be more specific? What fails; the flow, or the rundll32 command?Looking at the flow, it is definitely wrong. You will always execute the rundll32 command. (if %computername%==office4, then you will go to label :office, if not you will anyway run into :office).Try it as follows@echo offnet use y: \\file\ftp\%username%net use x: \\file\publicif NOT %computername%==office4 goto endrundll32 PrintUI.dll,PrintUIEntry /in /n \\file\lp01:end Quote Link to comment Share on other sites More sharing options...
leiw Posted September 27, 2006 Author Report Share Posted September 27, 2006 To assume there have office and computer room, when the user using office computers that the user only can see office printers but they must cannot see another room printers such as computer room.So my script only who using office computers that can only see office printers and the script is run by group policy, but when the user not using office computers, they still can run the script ....Thank !! Quote Link to comment Share on other sites More sharing options...
ɹəuəllıʍ ʇɐb Posted September 27, 2006 Report Share Posted September 27, 2006 I understand what you are trying to do; does my corrected script work any better? Quote Link to comment Share on other sites More sharing options...
leiw Posted September 27, 2006 Author Report Share Posted September 27, 2006 I will try your script tomorrow, do you know Con2prt.exe? I know Con2prt.exe for NT4, can its run on Windows2000 or 2003 server?Thank! Quote Link to comment Share on other sites More sharing options...
leiw Posted September 27, 2006 Author Report Share Posted September 27, 2006 I use administrator account to login client computer its will auto add printer by group policy but common user cannot .... how can I fix this problem ? Quote Link to comment Share on other sites More sharing options...
Scarecrow Man Posted September 28, 2006 Report Share Posted September 28, 2006 If you use runas /u:%COMPUTERNAME%\Administrator in your batch file, it will run the script with administrator credentials. I believe the password has to be typed, but there is a way to have it automatic. I am sorry I cannot remember this off the top of my head.here's some more information: http://blogs.msdn.com/aaron_margosis/archi.../24/193721.aspx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.