Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Map network drive window...

Status
Not open for further replies.

CCHelpDesk

IS-IT--Management
Mar 9, 2009
24
US
I have a login.bat file that runs when the user logs in. It maps a few network drives and a network printer. The DOS window doesn't come up but the window that says Mapping Network Drive that has a cancel button does come up.

Is there a way to stop that window from showing? I think that sometimes users may accidently hit the cancel button so they don't have these resources available.
 
Instead of using a batch file, create a VB script.

Good luck,
 
Thanks for the suggestion but in this environment I am unable to create a VB script to replace this batch file. I can however modify the batch file. So that is what I would like to do is modify the batch file to run silently so the user never sees this at all.
 
How are you mapping your drive(s) in your batch file? Have you tried using the net use command? Pass not only the mapping, but the user's credentials. Also, before your first net use, set the echo off (@echo off). You then should only see the command box flash and close.



 
hi,

does this directive to run login.bat come from a AD policy,
or other ?

bye
vic
 
the batch file looks like this...

NET USE W: \\192.168.1.50\Share1
NET USE V: \\192.168.1.50\Share2

rundll32 printui.dll,PrintUIEntry /in /n\\Server\PrinterName /u
rundll32 printui.dll,PrintUIEntry /in /n\\Server\PrinterName

It is set in the OU in AD (OU-Group Policy-User Config-Windows Settings-Scripts-Logon), we have several OU's all with their own batch file. So there is no need to pass the user login. Also the DOS window doesn't come up so the echo off makes no difference here.
 
hi,
I asked about AD, becouse there are some policy about this:

User Configuration - Administrative Templates - System - Logon/Logoff - RUN LOGON SCRIPTS VISIBLE

User Configuration - Administrative Templates - System - Logon/Logoff - RUN LOGON SCRIPTS SYNCHRONOUSLY

The 1st hides the CMD windows, so user cannot close it.
The 2nd does not set the login available until script is done.

You have to set the first after you test well it, and be ready to "unset" when something is not going to "see" what
is happening.

ciao
vittorio
 
Thanks for the suggestion Victor but we don't really want to move this into a per user setup. The way it is now all users in the OU group gets the specified batch file and we can modify a single batch file and all users in that OU will get the changes the very next time that they login. So it works great for us, we just need to run this batch in silent mode or something so that the user doesn't see that "Mapping Network Drive" window so they won't be able to click the Cancel button.
 
hi,
if you enable the Visibility Policy in the same OU in which you set the login.bat, all users will not see the CMD;
also

"User Configuration - Windows settings - Scripts (Logon/Logoff)"

is in User Configuration

Probably I have not completely understood.

bye
vic
 
When I go into Active Directory Users and Computers under Mydomain.com I see a list of OUs. I pick one and hit Properties. Once the properties comes up I go to Group Policy. In the Group Policy Object Links I have an item called Network Share. I select this and hit Edit. When the Group Policy(this is the GP for this OU only) window comes up I click User Configuration to expand it and then expand Windows Settings, then look in Scripts and Logon. When I select Logon I right click and hit propeties. I now see my single batch file that we have for this OU. So every user in this OU that logs onto a PC anywhere in our network/domain gets these same mapped drives.

If there is an easier way to get this same location for this OU then I don't know it (it is really nested). Also I don't see anywhere to set a Visibility Policy for this anywhere.
 
Thanks Vic,
Ok I was able to go back and read this and see exactly what you were saying. I have set these as you suggested (on 1 OU for now)and will have to give it some time to see if it works.

My initial testing of these changes does not seem to show a difference. I think this is to stop a command prompt window from appearing and as I have stated all along that is not what I am trying to stop. The command window doesn't come up but a normal GUI type informational box that says Mapping Network Drive that has a Cancel button on it. And the cancel button is selected by default. This is the window that I am trying to hide. Not a command prompt.

But as I said I will test this further to see if those 2 items make a difference (Run logon scripts synchronously and Run logon scripts visible). Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top