Announcement

Collapse
No announcement yet.

Errors running VB script on linux

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Errors running VB script on linux

    I am trying to make a simple VB script which is called by an HS3 event. The VB script will in turn pass the parameters to my bash script.

    When the VB script (below) runs, it produces the HS3 errors shown further down. There must be a typo in my script but I can see it. Can someone tell me how to fix my vbscript?

    Code:
    imports System.Diagnostics
    
    Sub Main(parm as object)
    Dim psi As New ProcessStartInfo()
    Dim param1 As String = Split(parm,",")(0).ToString
    Dim param2 As String = Split(parm,",")(1).ToString
    
    psi.FileName = "/bin/bash"
    psi.Arguments As String = "-c " & " ""/usr/local/homeseer/scripts/test.sh " & param1 & " " & param2 & " "" "
    
    psi.RedirectStandardOutput = True
    psi.RedirectStandardError = True
    psi.CreateNoWindow = False
    psi.WindowStyle = ProcessWindowStyle.Hidden
    psi.UseShellExecute = False
    
    Dim process As Process = Process.Start(psi)
    Dim processoutput As String = process.StandardOutput.ReadToEnd()
    
    process.WaitForExit()
    
    hs.writelog("Output", processoutput)
    
    End Sub


    Oct-27 12:36:39 PM Error Compiling script test.vb: 'End Namespace' must be preceded by a matching 'Namespace'.
    Oct-27 12:36:39 PM Error Compiling script test.vb: Identifier expected.
    Oct-27 12:36:39 PM Error Compiling script test.vb: Identifier expected.
    Oct-27 12:36:39 PM Error Compiling script test.vb: Identifier expected.
    Oct-27 12:36:39 PM Error Compiling script test.vb: Identifier expected.
    Oct-27 12:36:39 PM Error Compiling script test.vb: Identifier expected.
    Oct-27 12:36:39 PM Error Compiling script test.vb: Identifier expected.
    Oct-27 12:36:39 PM Error Compiling script test.vb: Identifier expected.
    Oct-27 12:36:39 PM Error Compiling script test.vb: Identifier expected.
    Oct-27 12:36:39 PM Error Compiling script test.vb: Identifier expected.
    Oct-27 12:36:39 PM Error Compiling script test.vb: Identifier expected.
    Oct-27 12:36:39 PM Error Compiling script test.vb: Expected 'End'.
    Oct-27 12:36:39 PM Error Compiling script test.vb: Expected 'End'.
    Oct-27 12:36:39 PM Error Compiling script test.vb: End of statement expected.
    Last edited by ocgltd; October 27th, 2018, 12:12 PM.
Working...
X