?
Solved

Network drive to changeing share names

Posted on 2013-10-28
3
Medium Priority
?
493 Views
Last Modified: 2013-10-28
I have a NAS and I need to backup to it's USB drive. However, each USB drive makes  a different share name when connected.
So I need a script to connect a drive to one of 3 different share names.

Like this:

Net Use Z: \\server\share1
or, if not available
Net Use Z: \\server\share2
or, if not available
Net Use Z: \\server\share3

Batch file or VBS would be great!
Any ideas!
0
Comment
Question by:OneGoodGeek
[X]
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
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
Dan Craciun earned 2000 total points
ID: 39606596
Why not use those exact commands in a .bat?

net use Z: \delete
net use Z: \\server\share1
net use Z: \\server\share2
net use Z: \\server\share3

It will connect on the working one and error on the rest.

HTH,
Dan
0
 

Author Closing Comment

by:OneGoodGeek
ID: 39606718
Ok, I feel stupid how easy that was!

Thanks a lot!
0
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39606835
I usually feel relieved if a solution is easy :) One less complicated thing to maintain.

You're welcome!
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Microsoft will be releasing the Windows 10 Creators Update in just a matter of weeks. Are you prepared? Follow these steps to ensure everything goes smoothly and you don't lose valuable data on your PC.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

777 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