You can run JScript (.js) and VBScript (.vbs) scripts directly in windows.
As you have a Javascript file designed to run on a web page, the environment it expects is different. The window and document objects are only available in the browser, so they do not work when running the script outside the browser.
The objects you have are ActiveX objects registered on the computer, for example, the Scripting.FileSystemObject object, which you can use to access the file system.
Guffa source share