Solved

NET USE * /DELETE Problem

Posted on 2010-11-19
4
892 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
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

820 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