How to Auto Submit a Form in VBScript

By dcsaha

Here is an example code snippet. Replace the site address, field names and values to match the form you want to submit. Save the code in a file and save it using vbs (VBScript) extension. Double click on the file and you are done.

Set IE = CreateObject("InternetExplorer.Application")
set WshShell = WScript.CreateObject("WScript.Shell")
IE.Navigate "http://mydomain.com/form.asp"
IE.Visible = True
Wscript.Sleep 2000
IE.Document.All.Item("uselectid").Value = "10001"
IE.Document.All.Item("category").Value = "19"
IE.Document.All.Item("rep").Value = "10001"
IE.Document.All.Item("title").Value = "A new problem title"
IE.Document.All.Item("description").Value = "Description of the new problem"
call IE.Document.Forms(0).Submit()

Leave a Reply