Solved

script to move files from a virtual server to a USB drive on the host server

Posted on 2013-01-25
3
371 Views
Last Modified: 2013-01-26
I have a Windows 2012 server that is a host to two 2008 virtual servers. There is USB drive connected to the server. It is recognized by the host but not by either of the virtual servers. I have a need to delete and copy files from one of the virtual servers to the USB drive. I would like to use a batch file to schedule a periodic operation. The problem I am having is the code to move across the servers.

Example of the setup and a simple line of code I am attempting:

hostserver has a USB Drive at H: on which there is a test directory.
vserver1
vserver2

The code resides on vserver1

rmdir /s/q "\\hostserver\H:\test"

The error that is returned is "the network name cannot be found."

If I can get the code to see across the server boundries the rest of the code will come easily.
0
Comment
Question by:gbm33
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
ID: 38820625
Can you get to \\hostserver at all from the virtual one?  Are they are on the same domain for instance?  In fact are they on the same vlan / ip range - quite possible that host and clients can't actually communicate directly.

For starters can you do \\hostserver from the hostserver Run / search button itself?

How about \\x.x.x.x ip address from the virtual machine if needed?

Having got that working (or not) then you are best setting up a share on the USB drive, i.e. share the directory as "test" or whatever with suitable permissions for the share and for ntfs security -- if this isn't a domain you will need suitable login users and, for instance, setup mapped drive using user/password.

What you have at the moment won't work as there isn't going to be a share called H:, you could probably use the administrative share H$ but best creating a specific one.

Steve
0
 

Author Comment

by:gbm33
ID: 38821167
dragon-it: I have worked it out with your nudging.  After setting up a share for the USB Drive and allowing others to manipulate the data within the share I have to use a series of net use commands to ensure that I have logged into the hostserver and have permission to do what I desire to do.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 38822105
Glad that helped.  You can do all and have it remembered:

net use /persistent:yes
net use x: \\hostserver\sharename /user:username password /savecred

If you have all you need select an answer when you are ready or can help more if needed.

Steve
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Problem Description: Actually I found the below issue with some customers after migration from SMS 2003 to SCCM 2007 and epically if they change site code, some clients may appear in the console with old site code, plus old sites still appearing …
Remote Apps is a feature in server 2008 which allows users to run applications off Remote Desktop Servers without having to log into them to run the applications.  The user can either have a desktop shortcut installed or go through the web portal to…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now