title: In vbscript how to run the bat file
body: <p>I am created the bat file using vbscript. And run that script But batch file is not run Please help me</p>
  
  <pre><code>Const ForReading=1, ForWriting=2, ForAppending=8
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set oServiceManager = CreateObject("com.sun.star.ServiceManager") 
  Set oDesktop = oServiceManager.createInstance("com.sun.star.frame.Desktop") 
  Dim aNoArgs() 
  Dim oDoc, myrows,inut, s, shell 
  s = 1
  Set outFile = objFSO.CreateTextFile("C:\Program Files\WinSCP\" &amp; "\Build.bat", True)
  outFile.Close
  Set outFile = objFSO.OpenTextFile("C:\Program Files\WinSCP\" &amp; "\Build.bat", ForWriting, True)
  outFile.WriteLine chr(34) &amp; "C:\Program Files\WinSCP\winscp.exe" &amp; chr(34) &amp; " /console /script=page.txt"
  outFile.Close
  Set outFile = objFSO.CreateTextFile("C:\Program Files\WinSCP\" &amp; "\Page.txt", True)
  outFile.Close
  Path = InputBox ("Enter Your Path:")
  inut = "file:///" &amp; Path
  Set oDoc = oDesktop.loadComponentFromURL(inut, "_blank", 0, aNoArgs) 
  oDoc.CurrentController.Frame.ContainerWindow.setVisible(false) 
  set oSheet = oDoc.Sheets.getByName("Sheet1") 
  set oCell = oSheet.getCellByPosition( 3, 2 ) 'A2
  DomainName = oCell.getString() 
  set oCell = oSheet.getCellByPosition( 3, 3 ) 'A2
  nFile = oCell.getString() 
  nFile = nFile - 1
  Set outFile = objFSO.OpenTextFile("C:\Program Files\WinSCP\" &amp; "\Page.txt", ForWriting, True)
  outFile.WriteLine "option confirm off"
  outFile.WriteLine "open sftp://root@" &amp; DomainName &amp; " -hostkey=" &amp; chr(34) &amp;"ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"&amp; Chr(34)
  outFile.WriteLine "option transfer binary"
  For i = 0 To nFile
  set oCell = oSheet.getCellByPosition( 0, s ) 'A2
  nValue = oCell.getString() 
  set oCell = oSheet.getCellByPosition( 1, s ) 'A2
  nsValue = oCell.getString() 
  outFile.WriteLine "put " &amp; nValue &amp; " " &amp; nsValue
  s = s+1 
  Next
  outFile.WriteLine "# Disconnect"
  outFile.WriteLine "# close"
  outFile.Close
  oDoc.Close(true) 
  msgbox "Done"
  set shell=createobject("wscript.shell")
  shell.run "C:\Program Files\WinSCP\" &amp; "\Build.bat"
  set shell=nothing
  </code></pre>
  
  <p>I am created the bat file using vbscript. And run that script But batch file is not run Please help me</p>
  
  <p><strong>Edited:</strong></p>
  
  <pre><code>Line: 49 Char: 1 Error: The system cannot find the specified Code: 80070002 Source: (nul)
  </code></pre>