HTTP GET Request, ASP – I’m lost!

Your code should look like this:- Function GetTextFromUrl(url) Dim oXMLHTTP Dim strStatusTest Set oXMLHTTP = CreateObject(“MSXML2.ServerXMLHTTP.3.0”) oXMLHTTP.Open “GET”, url, False oXMLHTTP.Send If oXMLHTTP.Status = 200 Then GetTextFromUrl = oXMLHTTP.responseText End If End Function Dim sResult : sResult = GetTextFromUrl(“http://www.certigo.com/demo/request.asp”) Note use ServerXMLHTTP from within ASP, the XMLHTTP component is designed for client side usage and … Read more

How can I convert a VBScript to an executable (EXE) file? [closed]

There is no way to convert a VBScript (.vbs file) into an executable (.exe file) because VBScript is not a compiled language. The process of converting source code into native executable code is called “compilation”, and it’s not supported by scripting languages like VBScript. Certainly you can add your script to a self-extracting archive using … Read more

How to use GetObject in VBScript

VBScript GetObject documentation can be found here. Here is a VBScript sample: Set objExcelFile = GetObject(“C:\Scripts\Test.xls”) WScript.Echo objExcelFile.Name objExcelFile.Close This code will get you the Excel Workbook object contained in C:\Scripts\Test.xls. You can use TypeName() to confirm that: Set objExcelFile = GetObject(“C:\Scripts\Test.xls”) WScript.Echo objExcelFile.Name WScript.Echo TypeName(objExcelFile) objExcelFile.Close The output will be: test.xls Workbook If the … Read more

WScript.Shell.Exec – read output from stdout

WScript.Shell.Exec() returns immediately, even though the process it starts does not. If you try to read Status or StdOut right away, there won’t be anything there. The MSDN documentation suggests using the following loop: Do While oExec.Status = 0 WScript.Sleep 100 Loop This checks Status every 100ms until it changes. Essentially, you have to wait … Read more