Archive
Packing code within code – a HTA exercise in string manipulation
I was working on a HTA tool this week, and to make things easier I wanted to encapsulate another HTA within it – really I just didn’t want to have to send two files to the user, I wanted everything in one, and rather than take the obvious approach of putting them both into a self-extracting zip, I decided to work out how to include the code of File B in File A.
Note – you can find the test files for this article on my companion site, CTOGoneWild
Pretty easy stuff I thought, just split B up into a string, and include a simple routine to write it out to the temp directory
1 : Dim s : s="Some text to output to a file" &_ 2 : " which is more than one line and go" &_ 4 : "es on a bit." 6 : Dim fso: Set fso = CreateObject("Scripting.filesystemobject") 8 : fso.createtextfile("test.txt").write s
HTA Login Box and Question/Answer for EEPC5
NOTE: These are now used in the AutoDomain 5.5x script.
I was playing around with Autodomain recently, and it occurred to me how awful, unreliable, and generally perverse it is to use internet explorer to collect information from the user.
Over the last few years, I’ve found that using IE as a way of presenting information to users from a VBScript tool is just fraught with problems. I’ve had machines tell me that IE does not exist (even though it was running at the time), IE has crashed, baulked, appeared minimized, behind windows etc. Generally it’s proven to be really, really unreliable. Read more…
Comments