Solved

Network drive to changeing share names

Posted on 2013-10-28
3
490 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 500 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

726 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