title: VBScript to copy files from documents library from Android device in my network to Windows directory
body: <p>I have .xlsx files in the documents folder of multiple Androids tablet devices on my network.  The directories are named the same.  Therefore the only difference between the directories is the devices name itself.
  e.g. 
  \device1\documents*
  \device2\documents*
  etc.</p>
  
  <p>I know the names of the devices on the network, and so I am trying to MOVE using VBSCRIPT all the files from the \documents* directory to a central directory on a computer in the same network, e.g. "\computer\desktop\devicedocumentfolder\"</p>
  
  <p>This is what I have so far.  Conceptually, I am missing something with the process of identifying the file(s) in each device directory and moving them all to the main computer where I am running this script from.  Any help would be greatly appreciated!</p>
  
  <pre><code>Dim oFSO, sDList, sDevice
  Dim file
  Const ForReading = 1
  
  'Get devices-------------------
  
  Set oFSO = CreateObject("Scripting.FileSystemObject")
  Set sDList = oFSO.OpenTextFile("c:[computername]\desktop\devicenames.txt")
  Do Until sDList.AtEndOfStream
  sDevice = sDList.ReadLine
  msgbox(sDevice)
  
  'Get and move files from each device to main computer -------
  mainComp = "\\c:[computername]\desktop\deviceDocuments\"
  file = "\\" &amp; sDevice &amp; "\documents\*"
  If oFSO.FileExists(file) Then
  msgbox("file exists")
  oFSO.movefile file, mainComp
  else
  msgbox("no files exist on this device")
  end if
  
  Loop
  sdList.Close
  WScript.Echo "Finished moving files from devices"
  </code></pre>