Solved

NET USE * /DELETE Problem

Posted on 2010-11-19
4
894 Views
Last Modified: 2012-05-10
Hi,

I am having problems with the following logon script:

@echo off
NET USE * /DELETE /YES
@echo off
net use o: \\server1\share1$
net use p: \\server2\share2$
net use q: \\server3\share3$

The idea is I want to dismount all network drives and then map only the drives in the Bat script.
If I run the script from my desktop it works correctly and my network drives are mapped.
When the same script runs when I login it disconnects all the drives but does not mount anything.

Its very strange that it works when I copy the Bat file to my desktop but not when I login.

Any idea's what might be the cause of this?

Hopefully I'm not being incredibly stupid!
0
Comment
Question by:martin25560
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Expert Comment

by:jfromanski
ID: 34172152
It works for me (XP, AD 2003). Try to debug a little:
- delete all @ECHO OFF lines
- add PAUSE as the last command
- try from remote location
0
 

Accepted Solution

by:
martin25560 earned 0 total points
ID: 34172532
I've found the problem.. The account I'm testing the script on has a static home drive mapping.
This was causing a problem with the login script and was unable to map the drives.
(It explains why when the bat file was copied to the desktop it was able to run without problems)

Cheers

Martin.
0
 
LVL 3

Expert Comment

by:Pratik Parmar
ID: 34172993
For Removing the Network Drives, It would be done Easily,

But To Mount The Shared Network Folders, you require their User Credentials to be cached on to your PC, Or Your Pc Should define a policy to cache the Credentials... and Configure Anonymous Shares Settings on Each PC that you want to be mapped as a netw folder,

You Can Define This Policy in Local Security Policy, and Set Security Options. .

Start > Run > Secpol.msc > Local Sec Policy > Local Policy > Security Options > Network access: Shares that can be accessed anonymously      (If you are currently Sharing files from your computer, do not change this field, if you do not want to share files on your computer, delete any entries that exist here) type name of Share e.g. \\Server1\share1

and
0
 

Author Closing Comment

by:martin25560
ID: 34203507
The account I'm testing the script on has a static home drive mapping. Removing it resolved the problem.
0

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

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

This article summaries thoughts and ideas from two years of sustained use. It provides good reasoning to make the jump to Windows 10.
Configuring Remote Assistance for use with SCCM
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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