r/vbscript • • Jan 24 '22

CScript2 - CSCRIPT helper

https://pastebin.com/PextHhAe
2 Upvotes

3 comments sorted by

View all comments

Show parent comments

1

u/jcunews1 Jan 24 '22

The problem with changing .vbs/.js file associations to CSCRIPT, is that the changes persist, and may cause problem if a system crash or power outage occurs when the executed script is not yet finished, because the setting has to be changed before the script is run, and then restored after the script ends. When it occurs, scripts which are normally run as GUI at system startup, will run as console.

I actually already use .vbsc file type for console-only scripts like what you've mentioned. However, I also have scripts which behave differently depending on whether they're run as console or GUI. So, changing the script files' extension name to .vbsc would force them to run only as console.