It's really pretty simple. You just create a ".js" file and then you can execute it FROM WINDOWS (for example, by dropping a shortcut to it on your desktop).
Instead of working with browser DOM objects, you work with WShell objects.
Here's a list of the available objects:
Primarily you will work with WScript and likely WshShell objects. You might also use WshArguments if you want to pass in arguments on a command line (which can, in turn, be part of the desktop shortcut).