title: sshpass some windows and run a network bat
body: <p>I want to write a bash script to sshpass Windows and run a network shared bat. The problem is that when I run the command</p>
  
  <pre><code>\\server_name\shared_folder\xx.bat
  </code></pre>
  
  <p>via cmd it is ok, but when I write it in shell script, I get the error</p>
  
  <blockquote>
    <p>bin/sh: server_nameshared_folderxx.bat: command not found</p>
  </blockquote>
  
  <p>It seems I do not write the path with correct style.
  should I using more <code>\</code> for the command in the script? Just like this?</p>
  
  <pre><code>\\\\server_name\\\shared_folder\\\xx.bat
  </code></pre>
  
  <p>sh Code:</p>
  
  <pre><code>copy_files(){
      sshpass -p Sybase123 ssh -o StrictHostKeychecking=no root@$machine "\\server_name\shared_folder\xx.bat"
      echo "-- Finished action on $machine!"
  }
  
  for machine in `cat $machine_file`
  do
      echo "$machine:"
      copy_files $machine;
  done
  </code></pre>