When I run the below command , the folder create shows completed in the log file of the windows 8 machine but it did not actually create the folder. However it does work on the linux machine. I have tried in the actions QNA and it shows complete in path of bes console\qna but the folder does not exist
if {name of operating system as lowercase starts with “win”}
folder create {(parent folder of client as string & “\test”)}
//wait cmd.exe /c "md "{(parent folder of client as string & “\Evidence”)}"
else
folder create {(parent folder of client as string & “/test”)}
//folder create "/opt/BESClient/bin/Evidence"
endif
Another thing that is good to think about when writing relevance evaluation is that the items between {} are just substitutes so it might be easier to do:
folder create "{ pathname of parent folder of client }/test"
as the substitution will just be put in there.
Note that your Evidence directory is going into the binary directory though, do you mean that?
If you want to go into the directory where __BESData is then:
If you have time for additional education. How would I add two additional statements if for the below
In addition to checking OS type how would you add a check to see if the folder already exists for both windows and linux similar to
if {not exists folder (parent folder of client as string & “/Evidence”)}
add after or before the “else” {name of operating system as lowercase contains with “inux”
if {name of operating system as lowercase starts with “win”}
folder create “{pathname of parent folder of client}\Evidence”
else
folder create “{pathname of parent folder of client}/Evidence”
endif
Thanks AlanM. As statement 1 and 2 solves all requirements as I did not know that number 2 would work for both OS types. Thanks for extending the statement example however.