I have a script that is deployed out to everyone of our agents (close to 900). All work fine with the exception of one company which has the script failing on every workstation, and 3 or so other random workstations with other companies.

The xml of the script will be below, but basically it performs a ping to google and writes the average to c:\kworking\average.txt it then reads back in the c:\kworking\average.txt file as a variable.

The problem seems that it is not writing the file of c:\kworking\average.txt. If I run the actual command from the command line it works fine with no issues.

Here is the error from the agent log file:

FAILED in processing THEN step 5, Get Variable, with error File Open Failed, Get content from file c:\kworking\Average.txt (Line 5)

Any ideas?

<ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">
<Procedure name="Collect Ping Latency - google.com" treePres="3" id="1797436089" folderId="12231621772311681451475746" treeFullPath="PITG.Monitoring.Reporting">
<Body description="This procedure will check network latency to Google.com when the procedure is executed. This writes the results to Kaseya and is viewable when viewing the agents.">
<Statement name="GetVariable" continueOnFail="false" osType="Windows">
<Parameter xsi:type="EnumParameter" name="VariableType" value="ConstantValue"/>
<Parameter xsi:type="StringParameter" name="SourceContent" value="google.com"/>
<Parameter xsi:type="StringParameter" name="VariableName" value="hostname"/>
</Statement>
<Statement name="GetVariable" continueOnFail="false" osType="Windows">
<Parameter xsi:type="EnumParameter" name="VariableType" value="ConstantValue"/>
<Parameter xsi:type="StringParameter" name="SourceContent" value="Average"/>
<Parameter xsi:type="StringParameter" name="VariableName" value="type"/>
</Statement>
<Statement name="ExecuteShellCommand" continueOnFail="false" osType="Windows">
<Parameter xsi:type="StringParameter" name="Command" value="cmd.exe /c "for /f "tokens=10 delims=;=;ms" %s in ('ping #hostname# ^| find "#type#"') do echo%s>>"#vAgentConfiguration.AgentTempDir#\#type#.txt"""/>
<Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System"/>
<Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False"/>
</Statement>
<Statement name="WriteScriptLogEntry" continueOnFail="false">
<Parameter xsi:type="StringParameter" name="Comment" value="cmd.exe /c "for /f "tokens=10 delims=;=;ms" %s in ('ping #hostname# ^| find "#type#"') do echo%s>>"#vAgentConfiguration.AgentTempDir#\#type#.txt"""/>
</Statement>
<Statement name="GetVariable" continueOnFail="false" osType="Windows">
<Parameter xsi:type="EnumParameter" name="VariableType" value="FileContent"/>
<Parameter xsi:type="StringParameter" name="SourceContent" value="#vagentconfiguration.agenttempdir#\#type#.txt"/>
<Parameter xsi:type="StringParameter" name="VariableName" value="results"/>
</Statement>
<Statement name="UpdateSystemInfo" continueOnFail="false" osType="Windows">
<Parameter xsi:type="StringParameter" name="ColumnName" value="Latency"/>
<Parameter xsi:type="StringParameter" name="Value" value="#results#"/>
</Statement>
<Statement name="DeleteFile" continueOnFail="false" osType="Windows">
<Parameter xsi:type="StringParameter" name="Path" value="#vAgentConfiguration.AgentTempDir#\#type#.txt"/>
</Statement>
</Body>
</Procedure>
</ScriptExport>