VBScript User Tools cause NWC2 to leave temporary files.
This does not seem to be a problem with WinXP
Under Win98SE, any time a User Tool is run, NWC2 creates 3 files in windows\temp in the form of nwt*.TMP. They are the STDIN, STDOUT, and STDERR. Usually these are deleted when the User Tool finishes, but if the tool "spawns" any processes, they are locked until the spawned process finishes and are never deleted. Here's a simple example:
'---- begin ToNotePad.vbs ---------------
Option Explicit
Dim fso: fso = CreateObject("Scripting.FileSystemObject")
Dim f: f = fso.GetBaseName(fso.GetTempName) & ".txt"
f = fso.BuildPath(fso.GetSpecialFolder(2), f) ' 2 = %TEMP%
fso.CreateTextFile(f).Write(WScript.StdIn.Read(46080))
CreateObject("WScript.Shell").Run(f) ' leaves %TEMP%\nwt*.TMP
WScript.Sleep 500: fso.DeleteFile(f)
If WScript.StdIn.AtEndOfStream Then WScript.Quit
MsgBox "Truncated to 45K bytes", vbExclamation, "Warning"
'---- end ToNotePad.vbs ---------------
The offending line is:
CreateObject("WScript.Shell").Run(f)
which runs notepad and loads the file. The temp files are locked until notepad is closed and never deleted.
I can't figure out how to avoid it. I can solve it with an onExit routine that deletes all the files it can that match the pattern, but if it can be fixed within NWC2, that would certainly be preferable.
I know nothing of PHP (and since I have failed at every attempt to become adept at "regular expressions", I'm not eager to learn.)
Can PHP "spawn processes"? (It may be called "exec" or "shell".) If so, does it leave the temp files?
Anyone have any ideas on the best way to handle this?