Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Need script to replace %oldservername% mapped drives with %newservername% Server 2003

Posted on 2004-10-07
Medium Priority
Last Modified: 2010-04-17
Hi all
I just need a script to replace all %oldservername% mapped drives to new %servername% mapped drives persistently. Can anyone help please?
Question by:chillinlong
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 41

Expert Comment

ID: 12255308
I've got a solution that quite a lot more complicated than that...  but you might find bits of it helpful (or at least amusing)

In my case, I had to rename all of my PCs and Servers.  That meant that I had a few hundred PCs that needed the following:

LVL 41

Expert Comment

ID: 12255347
...hey I didn't mean to hit Enter (so let me continue!)

That meant that I had a few hundred PCs that needed the following:

a) needed to be renamed
b) needed all mapped network drives/printer changed for all users on each PC (they are a per-user setting)
c) needed all of the shortcuts changed (where ever they are on the PC)
d) needed a registry "search and replace" for such things as installed software paths, etc.

So, I created a VB.Net program that runs at the login batch file... that does all of those things.  It uses a database of "before and after" names of servers (and ordinary PC that have file or print shares) to do it's magic.

The entire package is available at http://www.dpw.hood.army.mil/ftp/ReNamePCs and contains the VB.Net source code, overview, documentation, sample database, etc.   It does NOT include the actual program itself... you'll have to get someone with VB.Net to compile the program for you.

Hey, I'll admit... it's a bit of overkill for what you're asking, but  you're welcome to take a look, and use whatever you like.

Author Comment

ID: 12257475
Thanks for your input, it just seems a bit too much for the mapped drives to reconnect to a new server to have too install .net functions on all client machines to just run the script etc.

Preferably I need a small vbs script which will disconnect
%oldservername% to and edit to %newservername% only on mapped drives and persistent connection.

Thanks again for your help.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 41

Accepted Solution

graye earned 300 total points
ID: 12257732
Yeah, I kinda thought that might be the case...  Oh well.

So, are you sure you don't have PCs that have shortcuts scattered about their drives that point to the old server?

Also, remember that mapped drive letters are stored in the registry for each user on the PC... so if you have a shared PC, you'll have to fix the mapped drives for each user.  That's the part of the solution that's tought to do with a script... it'd be difficult for a script to mount all of the user's registry "hives" so that the script could fix the mapped drives.  The alternative would be to run the script for each user that logs on.

You guys don't already have the .Net Framework installed on your client PCs ?!?!?!

Hey, I'm not trying to convince you of anything... just pointing out the pitfalls of what seems to be a simple problem with a simple solution.

Author Comment

ID: 12272978
Ah well nobody else has answered.

Thanks again for your response you can have the points for the effort you made cheers again.

Author Comment

ID: 12792582
I seem to be struglling trying to run this vbs files you mentioned. I appreaciate there is a manual but I still cannot find the programs to make these scripts work.

Where do I start please?

LVL 41

Expert Comment

ID: 12799763
We typically only distribute "source code"... not complete applications.   So the files that are available on our web site require the Visual Studio .Net 2003 package to compile the source code into programs that you can use.

That means you're gonna have to find somebody with Visual Studio .Net 2003 installed to compile it for you.   Sorry about that

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

636 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