4 ms·
How can a js file execute by clicking it? I have never seen that happen. Did you bind the file extension somehow your self?
by rightbyte 4y ago
How can a js file execute by clicking it? I have never seen that happen. Did you bind the file extension somehow your self?
- forgotusername6 4y agoYeah probably. I was a little surprised myself, but it is my dev machine so not that surprised
- wongarsu 4y agoJScript (Microsoft's JavaScript dialect) can be used as a general purpose scripting language (in purpose similar to shell scripts or maybe VBA, but using JavaScript and ActiveX). And until you install your first code editor to map the file extension to, the default action on double click is to execute the script. Or at least that used to be the case, not sure if this is still a thing in Windows 10/11.
- int_19h 4y agoActive Scripting, including JScript, still ships out of the box in Win11. The file extension association is also there, but I don't recall if it's active by default, or you get the "how would you like to open?" dialog first.
- None4U 4y agoThis is the default behaviour in Windows. It runs in the Windows Script Host as JScript (Microsoft's version of ECMAScript) and has access to basically anything Win32 the current user has, the same as macros in Office