Touch for HTTP in VB Script

There are times when I need a Windows program that performs an outside function to simply access a website with a particularly formed URL. Many times, these programs do not have an option to “touch” a URL. By touch, I am referencing the touch command in Linux which creates an empty file. Sometimes I need to touch something like http://www.somewebsite.com/folder/update.php?q=Update. I could use wget for Windows, but why do that when I could use a built-in function of Windows. I wrote a VB Script that simply “gets” a URL and exits.

' httptouch.vbs
' Created by Jason C. Greb
' http://www.electronerdz.com/

Set Args = WScript.Arguments
URL = Args(0) ' Read argument (must be in quotes)
Set oHTTP = CreateObject("MSXML2.XMLHTTP")
oHTTP.Open "GET", URL, False
oHTTP.Send() ' Send to the server
'Wscript.Echo oHTTP.Status ' Output the status if you'd like
Set oHTTP = Nothing

This script takes an argument after it, in quotes, and accesses that URL, then quits. You can add it to your program that runs an external program and put the argument after it. Keep in mind that you may need to reference the cscript.exe file (usually in system32) then the script, then the argument.

TimeKeeper over subnets

If you use Kronos TimeKeeper on a large network, you’ve probably had issues with running it in different subnets or VLANs. It says that it can’t find the database even though you have mapped the necessary drives. I’ve had those very issues, but apparently, TimeKeeper doesn’t have a way to fix it. I found a way today.

The best I can figure, TimeKeeper sends out a broadcast packet during the install to find out where the server is. On a subnetted network, this won’t help. TimeKeeper creates several ODBC entries during the install. In these entries, you manually specify the the server IP address. Go to SystemDSN in the ODBC control panel options. You will see three entries for TimeKeeper. Edit each one, and on the Network tab, add Host=[ipaddress] to the TCP/IP options where [ipaddress] is the IP address of the server TimeKeeper is installed. It should work beautifully after that.