gbm33
asked on
script to move files from a virtual server to a USB drive on the host server
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER