Does this look right? The usage would be .\ScanMode.vbs True or .\ScanMode.vbs False
WScript.Echo ScanMode(WScript.Arguments.Item(0))
Function ScanMode(Mode)
Option Explicit
Dim ConWSH, strConnection, strSQL1, Mode, rs1, adOpenForwardOnly
Set ConWSH=WScript.CreateObject("ADODB.Connection")
strConnection = "Driver={SQL Server};Server=DBSERVER;User ID=DOMAIN\USER;Password=pwd;Database=LansweeperDB;"
with ConWSH
.ConnectionString=strConnection
.ConnectionTimeout=25
.CommandTimeout=25
.Open
end with
strSQL1 = "Update tsysconfig Set activescanning='" & Mode & "'"
set rs1=createobject("ADODB.Recordset")
with rs1
.activeconnection=ConWSH
.CursorType=adOpenForwardOnly
.CursorLocation=3
.open strSQL1
End With
End Function