I am trying to write a probe that uses the execute function and cannot get it to work. My Dude is version 4 Beta 2 running on a Windows 2003 server. I initially wrote the probe I wanted but could not get it to give me any results. I have been fault finding as recommended in other places in this forum by adding the probe code to a device label to be able to see the results.
I have gradually reduced the complexity of the probe to a point where it no longer relates to what I am trying to do - so please don’t ask why I am trying to write such a stupid probe ![]()
I think I have now arrived at a point where it is beyond doubt that it is the execute function that doesn’t work properly, but I will be happy to be corrected on that if someone can point out the error of what I have done.
Here is the code that I have in my device label:
[array_element(execute("cmd.exe","echo test","c:\windows\system32"),1)]
I would expect “test” to appear on my device label but nothing appears. If I change the code to:
[array_element(execute("cmd.exe","echo test","c:\windows\system32"),0)]
Then the device label shows “-1”, which to my understanding of the way that the execute function is supposed to work indicates that it has returned an error.
I have also tried “escaping” the file path as suggested elsewhere in the forum (c:\windows\system32) to no avail.
Has anyone else had success in using the execute() function?
