Running VBS script in IIS

Sometimes you might want to deploy an incoming webhook for very simple use and do something when it’s called. On Windows you don’t need to have a full blown ASP.NET pipeline or even PHP server installed, you can go with simple VBS script. In this post I describe how to configure IIS to expose such a script and be able to accept incoming connections.

IIS

  1. Install IIS and CGI module
  2. Go to IIS and choose the site for VBS scripts
  3. Open Handler Mappings and choose Add Script Map…
  4. Set Request Path to *.vbs
  5. For Executable use the “C:\Windows\System32\cscript.exe” //NOLOGO %s %s
  6. Name it anything you would like

That’s it. Do not forget to add a binding.

Script

Now a simple script responding to a request.

You actually need to start output in the first two lines of your script or else will ignore it. Apart from that you can do basically anything you like.