Link to home
Start Free TrialLog in
Avatar of Mike Caldwell
Mike CaldwellFlag for United States of America

asked on

How to move a file from my local machine to a remote machine on my LAN?

I have TV shows recorded OTA and saved on my local machine.  I want to write a VB Script to move finished files to my media server on the same LAN.  I can handle all of the VBS programming, except I don't know how to address the folder on the media server.  The script will run on the local machine.  Some details:

Local machine = "MIKE7" running Windows 10.
Local file is in "D:\Tablo\"

Target machine = "Media_Mike" running Ubuntu 14.04.  I also have a static IP for this machine if that would be better to use.
Target folder = /mnt/media/Media_in
Avatar of Mark Bullock
Mark Bullock
Flag of United States of America image

You have to share the folder on the Ubuntu machine so the Windows machine can write to it.
Here are steps to do that with Samba (SMB for Linux):
http://www.noobslab.com/2014/02/create-safe-easy-shares-using-samba.html
http://ubuntuhandbook.org/index.php/2014/05/ubuntu1404-file-sharing-samba/

Access it using a UNC name \\yourubuntu\, or
map the folder to a drive letter, say U:, and use U:\
Avatar of Mike Caldwell

ASKER

OK, I have Samba installed and set up.  In case someone else reads this, I will post an additional step that was required, apparently for Ubuntu 13 and 14.04:

Fix For Ubuntu 14.04 .. Make sure Samba is not installed. Then open terminal & type "sudo apt-get install gksu"  (Without The Quotes).

Then type gksu-properties

In the dialogue that follows set authentication mode to "sudo" and grab mode to "enable"

Now Install Samba everything should be working & it show up on Unity Bar & Search.

I tried without this and Samba could not be found.  Then I found the above instruction and it is now installed and configured.  Now for the next step!
Quick VBS question:  should my address for moving to be

\\tablet\mnt\media\Media_in
So, test script should be pretty simple.  Here is what I have tried, and it does not work:

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "D:\VBS\Test.mp4" , "//FamilyRoom/mnt/media/Media_in/Test.mp4"

I get a run time error "Bad file name or number, Line 2".  FamilyRoom is the machine name.
I have clicked through the Files tree and verified that the Media_in folder is shared with wide open permissions and that the case in all names is correct.
I also tried the same script using the IP address of the machine.
OK, soooo, my slashes were backwards.  Fixed that; no change.
You checked the Files tree on your Ubuntu machine?
What happens when you use Windows Explorer to open \\FamilyRoom?
It opens, and not just the folder I shared using samba.
But I don't want to mount a drive.  I've had too many problems with drives dropping off or not mounting on a reboot, but an address is more faithful.
I'm sorry I didn't understand your answer.
What happens when you use Windows Explorer to open \\FamilyRoom? What files do you see?
Every folder is available to me, even those that have not been shared using Samba.
ASKER CERTIFIED SOLUTION
Avatar of Mark Bullock
Mark Bullock
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial