Solved

NET USE * /DELETE Problem

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now