Delete Mapped Network Drive & Connect to new Nework Share on same drive letter - Net Use Logon batch file

I have a logon batch file to map a newtork share.  The file share was moved to a new server.  I need to change the logon batch file to delete the old mapped drive and connect to the new file share on the same drive letter.  

net use z: /delete
net use z: "\\server\share name" /persistent:yes

When I run this it doesn't do anything.  
I can manually enter the commands in a command prompt window and it works fine.  

It's just an old batch file and I need to get it fixed ASAP.  
LVL 1
ehessAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
ehessAuthor Commented:
I had been testing on my Windows 7 workstation and just tried it on an XP box.  It worked, must be a privilege level.  If anyone has any better ways to do this with a logon script, please post it.  
0
 
yo_beeDirector of Information TechnologyCommented:
What does this work on XP or W7?
0
 
yo_beeDirector of Information TechnologyCommented:
Do you have a Domain with GPO's in place?
Add RSAT to your W7 machine and use GPP Drive Mappings
http://blogs.technet.com/b/askds/archive/2009/01/07/using-group-policy-preferences-to-map-drives-based-on-group-membership.aspx
You can all use a standard batch
Net use * /d /y

Rem Remap
Net Use n: "\\unc"
and so on.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
ehessAuthor Commented:
it works on xp.  i do have a domain with gpos in place.
0
 
yo_beeDirector of Information TechnologyCommented:
download RSAT for Windows 7  and create a GPP for Drive mapping.  This will give you much more flexibility for controlling and managing your domain machines.


For this to work on XP you will need to install Group Policy Client side Extension.

What error are you getting when you using the Bat logon script for your W7 machines?
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
ehessAuthor Commented:
I've placed the policy on the Server 2008 GPO for the affected group.  I'll find out tomorrow if it is working for the users.  
0
 
yo_beeDirector of Information TechnologyCommented:
should work as long as your GPO applies to the proper OU.
0
 
djpazzaCommented:
Its probably a permission problem / user account control.  When you type the commands manually and it works are you running the cmd as administrator?.
0
 
ehessAuthor Commented:
I have setup the Map Drive in the GPO, but it still isn't showing the new server share.  I have verified the GPO is applying for the user and already ran the gpupdate /force.
0
 
ehessAuthor Commented:
On the GPO setting I did check the Run in logged-on user's security context on the Common tab.  

The drive still wasn't mapping so I went back to the old batch file to run as the logon script.  The logon script also has a time source setting which requires admin priv. so that explains why it gets an error on W7.  

I'll create a test GPO and get that working for the drive map, but for now the end users have the correct server share when they logon.
0
 
yo_beeDirector of Information TechnologyCommented:
can you post some screenshots of the GPO as well as the OU structure?
0
 
yo_beeDirector of Information TechnologyCommented:
I did not see that this was accepted.
Please ignore my last post.
0
 
ehessAuthor Commented:
I am pleased to report that the GPO drive mapping works properly.  
0
 
yo_beeDirector of Information TechnologyCommented:
That is  wonderful.
GPP is a real help.  It took the place of custom scripting, which is not to know, but if it can be completed easier more power.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.