Avatar of OGSan
OGSan
Flag for United States of America asked on

Files copied to new network share - need to update shortcuts - how?

Our IT Dept has copied all of our files to a new network share.  The files in the original location were still accessible.  Since many employees did not update their shortcuts, they wound up maintaining the files in the original location.  Others, of course, are maintaining files in the new location.
...Sigh.
I found a shareware utility that will synchronize the files across two locations (http://www.alwaysync.org), which is working just great.
The other problem is:  How can I update the shortcuts on each employee's PC to ensure that they are pointing to the correct network share?
Here is an example:
"Y" drive letter mapped to Original location:  //nfs1/dept/hr/hris
needs to be updated to map to New location:  //ad.companyname.com/nfs1/dept/hr/hris
Somehow I need to update each mapped drive letter by inserting "//ad.companyname.com/" in place of the leading "//".  Is it possible to create a script to do this that each individual can run on their own?
Shell ScriptingWindows Batch

Avatar of undefined
Last Comment
OGSan

8/22/2022 - Mon
Brad Bouchard

It would be super easy.  Create a logon script and apply it through Group Policy at the Computer level.  Simply create a batch file that checks for the old mapped y drive, then, if it exists, removes that y drive, and recreates a new mapped drive y that goes to the new location.  something like this

net use y: /delete
net use y: \\SERVERNAME\NEWSHARE /persistent:yes

Create a text file with those two lines in it and save it as a .bat file.  Create the logon GPO in Group Policy Management and apply it to whatever OU you want it on.  Let it run for a week or until you're sure it's touched every one's computer.  Then just remove it as it won't be needed.
Brad Bouchard

My above suggestion doesn't actually check for the old Y mapping and remove it, it just removes any mapped Y drive on the computer, then recreates it with the new mapping.  If you really wanted it to only create the new Y mapping after it had checked for the old y, removed it, then re-created it, simply add an if/then statement to the script.  Something like:

IF NOT EXIST Y:\
END
ELSE
NET USE Y:\\SERVERNAME\NEWSHARE /PERSISTENT:YES
END
SOLUTION
Brad Bouchard

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Brad Bouchard

You got it my friend.  No objection here.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
OGSan

ASKER
I found this article after searching through the article provided by xBrouchardx.