(imported topic written by mbp911)
I am trying to create a task that will download a file, copy it to a folder and read the file for the existance of the machine name and then create a registry key based on its finding.
I have had success within the fixlet debugger, but the deployment of the task will give me a Relevance substitution error in the client log and the task will show a “Invalid action content: the action script contains a syntax error” error. However, if I split the task into 2 different actions, it is successful. 1 Task
download and copy
, 2 Task
Recurse and Set Key
.
Orginally I thought maybe it was a timing issue and placed a “pause while not exist file”, but that proved unsuccessful as well. I am about ready to lose my mind with this very simple task and seek some help. Any insight is appreciated.
Action Script
download http://Servername:52311/Uploads/STORES/Packages/Tiers/nordictiers.txt
//Create Packages Folder
if {not exists folder “c:\packages”}
waithidden cmd.exe /C mkdir c:\packages
else
endif
//copy file
copy “__Download\nordictiers.txt” “C:\packages\nordictiers.txt”
//determine if machine is in file and assign tier
if{(exists preceding texts of firsts “,” of lines whose (it contains hostname as lowercase) of file “C:\packages\nordictiers.txt”)}
parameter “TR” = “{(following text of first “-” of following texts of firsts “,” of lines whose (it contains hostname as lowercase) of file “C:\packages\nordictiers.txt”)}”
regset "
HKEY_LOCAL_MACHINE\Software\BigFix\Patch
" “Tier”="{(parameter “TR” of action)}"
else
regset "
HKEY_LOCAL_MACHINE\Software\BigFix\Patch
" “Tier”=“5”
endif
nordictier.txt File format
pc123,Tier-1
pc456,Tier-2