Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapped Drives 3

Status
Not open for further replies.

Pebkac

Technical User
Mar 28, 2002
16
US
Does anyone know how to force a mapped drive from a cmd?
There is a logon script that is run to redirect a drive letter for the Anti Virus software update. But we have hardcoded paths that use the same letter (to a different location)

Is there a way to make a bat file that will correct this after the other Bat file is run? I tried to use the same file but it uses NBPSHPOP and my 2000 desktop does not recognise it.

Any ideas? I realize I can re-map it but that is getting old at this point.
 
Are you using Active Directory. If so, you can go into the properties page of the users, and put a batch file in the scripts line of profile. Glen A. Johnson
Microsoft Certified Professional

"Things are not always as they seem;
the first appearance deceives many."
Phaedrus (15BC - 50AD) Roman poet, short-story writer

 
I hope im understanding your needs clearly here..this is what it sounds like you need to do from a command prompt or batch file (assuming a drive letter X: is what you wish to delete):
net use /delete x:


then replace it with:
net use /Persistent:yes (or no) x: \\servername\sharename

if you choose yes, the connection will remain mapped after a logoff/logon. If you choose no, the connection will be used only for that session.

Hope that helps. pbxman
Systems Administrator

Please let Tek-Tips members know their posts were helpful.
 
For pbxman

Yes the batch file works - but it still disconnects itself as it does when you map the drive in Windows.
 
You can write a batch file for the PC that has the same commands as the login scripts

net use X:\ \\Server\Drive CJ
- Paper MCSE in training
 
Are you saying that the logon script runs with drive "x:" mapped to....\\servername\virusdefs. Then after the virus defs are updated, you have an app that uses drive "x:" mapped to say \\servername\apps, and you want the logon script to run the virus updates, then remap the correct drive before the user is allowed to run anything?

Im confused as to what you mean by "but it still disconnects itself as it does when you map the drive in Windows."

Why not use a different drive letter entirely for the virus updates? There's a whole alphabet's worth of letters to choose from - it doesn't matter which one you use as long as it's free. Please give more info if you can - there may be a better way to do what you want, but im a little confused as to what exactly the goal is, and when you want it all to take place. pbxman
Systems Administrator

Please let Tek-Tips members know their posts were helpful.
 
i am not sure who put in that it disconnects same as the user. But I am the one who stu@tcm (Visitor) is.

wrote the original problem. I have created the bat file and then just put it in the startup folder and it run auto for me after the login bat runs.

The original issue was to find a way to re-create the mapped drive T to \\servername\apps (hard coded for an old program I run ), but the problem is that the AV program overote for it's \\servername\virusdefs , our IT guy(I think that is bogus) says that it is hard coded from Norton for the T drive

I was just getting tired of creating the mapped drive on my machines everyday.

I am all set now.
 
Oops Let me rephrase that. I am not sure who stu@tcm (Visitor) is but I am Pebkac and the originator of this, and I am all set.
 
Who are eagles1 and netwalker? I need a laugh, where can I read about them?
 
Right let's start at the begining.
My probelm was nothing to do with virus checkers, I just seemed to be having a similar problem and have served to totally confuse the issue -sorry about that.
We are using a backup program on a Win 2k [professional] machines some on domains and some on workgroups - this works by backing up the data from a mapped drive on the "server" [or wherever the central data is stored]. On most of the machines the drives appear disconnected [i.e. with a red X on them] after a period of time. If you are using a 2k machine as a workstation this is not a great problem as it reconnects when you start using it - but our backup program still sees the drive as disconnected and therefore does not backup the data.
The point I was trying to make earlier is that this occurs wether you map the drive in windows or use the code above either through DOS prompt or as a batch file.

Regards

Stuart
 
ahhh..now i gotcha :)

For the workstations that get this red X, edit their registries at:

HKEY LOCAL MACHINE\system\currentcontrolset\ Services\LanmanServer\Parameters

set the "autodisconnect" value to:
ffffffff

(in hexadecimal)

Reboot

..No more red X's. :)

Hope that does it for ya. pbxman
Systems Administrator

Please let Tek-Tips members know their posts were helpful.
 
Hi, have the same WIN2000 prof. problem :
For the workstations that get this red X, edit their registries at:

HKEY LOCAL MACHINE\system\currentcontrolset\ Services\LanmanServer\Parameters

set the "autodisconnect" value to: ffffffff

but I had no such entry, so I did create one, REG_DWORD = FFFFFFF
so let us see, whether it works

dernachtwerker.de
 
I just posted and low and behold..my answer is right here and I didn't realize it. I'll try it for opening business on Monday to see if it works! :) If it does PBXMAN is getting a star from funky

 
Here's my problem...

Through TOOLS-->MAP NETWORK DRIVE in windows, I mapped my Q: to the following location
"\\hq4cluster1-hq4p1v1-server\hq4p1v1\WIRERM\MANAGEMENT REPORTS\2003\Backup Reports\GPS_Logs"

Each night, i leave my PC on all the time, the LAN drops and my little red X comes up on the drive. I used the hex fix that PBXMAN listed above. The red X is gone but for some reason my scheduled task cannot write to that drive?!

I figured that my best course of action would be to use a separately scheduled bat file that uses the "NET USE" command to map the drive right before the scheduled job runs to ensure that it is mapped and I can write to that drive. As I'm sure you noticed there are spaces in the LAN location I am trying to map and I am not able to change the LAN structure. Can I use the NET USE command for

"\\hq4cluster1-hq4p1v1-server\hq4p1v1\WIRERM\MANAGEMENT REPORTS\2003\Backup Reports\GPS_Logs"

without having to worry about spacing? Is there a way I can schedule a non-command mapping each day? I would prefer the NET USE command I think but at this point i'll do anything to get this working each morning and not having to worry about the LAN dropping.

Best,
Matt
 
Anyone an expert using the NET USE command while mapping locations with spaces in the name (see above)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top