Solved

NET USE * /DELETE Problem

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

770 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