'ReadIPPORTfromSedifsys Function nor27(strTxt) Dim key, strCipher, i key=27 for i = 1 to len(strTxt) strCipher = strCipher & Chr(Asc(Mid(strTxt,i,1)) Xor key) next nor27 = strCipher end function Dim sedifPath Set oSh = CreateObject("WScript.Shell") sedifPath = oSh.RegRead("HKLM\SOFTWARE\Tradelink\iTVS4\serverpath") 'Msgbox "Registry ServerPath : " & sedifPath,,"Server Path in Registry" Dim SQLSvrIP Dim SQLSvrPORT Dim i Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(sedifPath & "\sedifsys.ini", 1) do while objFile.AtEndOfStream <> True SedifLine = objFile.Readline if LCAse(Trim(Left(SedifLine, 8))) = "sqlsvrip" THEN SQLSvrIP = nor27(right(SedifLine,len(SedifLine)-9)) 'msgbox "SQLSvrIP in Sedifsys.ini" +vbCRLF + SQLSvrIP, ,"SQLSvrIP" i=i+1 end if if LCAse(Trim(Left(SedifLine, 10))) = "sqlsvrport" THEN SQLSvrPORT= nor27(right(SedifLine,len(SedifLine)-11)) 'msgbox "SQLSvrPORT in Sedifsys.ini" +vbCRLF + SQLSvrPORT, ,"SQLSvrIP" i=i+1 end if loop if i=2 THEN dim con con = SQLSvrIP&","&SQLSvrPORT If inputbox("Please input the SQL server database IP/PORT","Fix",con) <>"" then else WScript.Quit end if Dim File, Conn, RS1 Set Conn = CreateObject("ADODB.Connection") Conn.Open _ "Driver={SQL Server};Address=" & con & ";Server=;" & _ "Network=DBMSSOCN;" & "Database=;" & "Uid=sa;" & "Pwd=Tradelink123" Set RS1 = Conn.Execute("use ITVS_CORE;delete from OUTBOX where MType = 'UPGACK';") Msgbox "Fix applied successfully." end if