Today I've been troubled by a pesky random issue with our ImageInvoker. Sometimes, we have network problems which throw the ImageInvoker service into a fit.
ImageInvoker works by exchanging files across a file share as communication 'envelopes'. The client saves a .ini file to the express share to ask the server a question, and the server saves an .rsp file which is the reply that the client reads.
The problem seems to be that sometimes the .ini file isn't accessable at the moment ImageInvoker process attempts to read it. So I ammended the code to combat this, but then wondered how to simulate this rare problem.
My first approach was to use the following vbscript to open the file and lock it for editing. This is what I thought would most closely resemble an open file handle from a slow write on a contended network,
Dim fs0,tsDim myfileSet fso = CreateObject("Scripting.FileSystemObject")Myfile="C:\Program Files\Altiris\eXpress\Deployment Server\Temp\ImageInvoker_In\000c291f60bf.ini"Const OpenFileForWriting = 2Const OpenFileForAppending = 8Set ts = fso.OpenTextFile(myfile, OpenFileForAppending,True)msgbox "Locked"ts.close
Now, if only we could actually image across that network.... ;-)