I maintain a good number of vbscripts for performing various startup scripts on my network and have a handful of functions that I use in almost all of them.
Short of copy and paste, does anyone have suggestions for how I can go about creating libraries of reusable vbscript code. I’m not averse to using a code generator for doing so as long as it isn’t more of a headache than copy and paste is. But any recommendations would be appreciated.
Thanks
VBScript has the
Executestatement, so if you don’t want to go the WSF route Tester101 proposes, you can do an include like this:Assuming
'your_library.vbs'would contain a class definition forFooClass.Be sure to call Execute in global context, or you will get into scoping issues.
Of course be sure to have all your files under tight control to prevent malicious usage.