title: Script is no longer executing correctly after Windows upgrade and switching to copssh
body: <p>I have an issue after Windows (from 2012 to server 2019) and Office (to 2016) update to newer versions. When we call a VBscript remotely thru ssh it does not work correctly.
  The issue we have with the scripts called thru ssh is still present and maybe someone can help. When we run the script on bash, when started directly on the Windows server it works correctly. When we call it from another server via ssh - it does start, work and some functions execute, but not all. For instance the system functions in the vbs as copy, paste etc. work, but excel functions don't. I guess if we call the script from ssh we are missing something in the environment (since the scripts works if it is called from the windows server without ssh), but I can't find what is missing.
  Any help on that?</p>
  <pre><code>Script:
  `Option Explicit
  
  Dim path, inFile, inFile2, dataFile, dataFile2, outFile, objExcel, objWorkBook, objWorkBookData, lastRow, fso, userName, stdout, reportName, uName, outFileXLSX
  
  Wscript.Echo &quot;Script start&quot;
  On Error Resume Next
  
  ..... 
  
  Wscript.Echo &quot;Before file copy&quot;
  ' copy files
  inFile2 = path &amp; &quot;\tmp\infile&quot; &amp; uName &amp; &quot;.xlsb&quot;
  dataFile2 = path &amp; &quot;\tmp\datafile&quot; &amp; uName &amp; &quot;.xlsx&quot;
  fso.CopyFile inFile, inFile2, True
  fso.CopyFile dataFile, dataFile2, True
  inFile = inFile2
  dataFile = dataFile2
  
  ' DEBUG
  Wscript.Echo inFile2
  Wscript.Echo dataFile2
  Wscript.Echo &quot;Before file open&quot;
  ' open workbooks
  Set objExcel = createobject(&quot;excel.application&quot;)
  If IsObject(objExcel) Then
      Wscript.Echo &quot;Object exists&quot;
  End If
  objExcel.AutomationSecurity = 1
  objExcel.Visible = False
  objExcel.DisplayAlerts = False
  Set objWorkBook = objExcel.Workbooks.Open(inFile)
  Set objWorkBookData = objExcel.Workbooks.Open(dataFile)
  
  ' DEBUG
  Wscript.Echo objWorkBookData.Worksheets(1).cells(6, 1).value
  
  ' write title page info
  objWorkBook.Worksheets(1).cells(16, 1).value = objWorkBookData.Worksheets(1).cells(6, 1).value
  objWorkBook.Worksheets(1).cells(17, 1).value = &quot;Report-Erstelldatum: &quot; &amp; Now
  
  ....
  
  ' save report
  outFileXLSX = Mid(outFile, 1, (Len(outFile)-1)) &amp; &quot;x&quot;
  If fso.FileExists(outFileXLSX) = True Then
      Call fso.DeleteFile(outFileXLSX)
  End If
  objWorkBook.SaveAs outFileXLSX, 51
  Wscript.Echo outFileXLSX
  objWorkBook.Close True
  objWorkBookData.Close True 
  objExcel.Quit 
  WScript.Quit
  
  On Error Goto 0
  
  
  
  
  
  Output from windows server called from bash console (NOTE - reads Excel files and creates 11111Report_test.xlsx at the end):
  bash-3.2$ cscript report_2.vbs Report_test.xlsx 11111
  Microsoft (R) Windows Script Host Version 5.812
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  Script start
  Before file copy
  C:\Users\user\Documents\tmp\infile11111.xlsb
  C:\Users\user\Documents\tmp\datafile11111.xlsx
  Before file open
  Object exists
  Creation date: 19.09.2022
  C:\Users\user\Documents\reports\11111Report_test.xlsx
  
  Output from ssh terminal (NOTE - does not read the data from the Excel file after &quot;Object exists&quot; and 11111Report_test.xlsx is not created):
  $ cscript report_2.vbs Report_test.xlsx 11111
  Microsoft (R) Windows Script Host Version 5.812
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  Script start
  Before file copy
  C:\Users\user\Documents\tmp\infile11111.xlsb
  C:\Users\user\Documents\tmp\datafile11111.xlsx
  Before file open
  Object exists
  C:\Users\user\Documents\reports\11111Report_test.xlsx `
  </code></pre>