Solved

NET USE * /DELETE Problem

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
pdf convertor 7 65
laptop estate analysis 5 62
Hyper-V Export VM failing / Checkpoint Issues 1 19
Searching good PDF to OCR 7 33
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
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.

912 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

20 Experts available now in Live!

Get 1:1 Help Now