(imported comment written by GreenEagleLeader)
Here is an article for how to do something similar involving a .reg file (same concepts appy)
How to create a registry entry on-the-fly using appendfile or createfile. Using the following instructions you will use basic appendfile or createfile commands to create, modify, or delete registry entries on TEM endpoints.
-
Create a filename.reg file using notepad.
-
Using Notepad and the following template create the registry values in the .reg format:
Syntax Template:
RegistryEditorVersion
Blank line
[RegistryPath1]
“DataItemName1”=“DataType1:DataValue1”
DataItemName2"=“DataType2:DataValue2”
Blank line
[RegistryPath2]
“DataItemName3”=“DataType3:DataValue3”
Example:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TmFilter\Parameters]
“DebugLogFlags”=dword:00000000
*See the following for additional details from Microsoft:
http://support.microsoft.com/kb/310516
-
Save the file as a registry file (filename.reg ). Execute this registry entry on a test machine. Do not proceed until the registry file is correct and applies appropriately.
-
Create the file using actionscript:
Createfile
Line1: delete __createfile <<Always delete __createfile prior to execution.
Line2: createfile until __END <<Text between createfile and _END
Line3: copy first line of registry (*.reg) <<Registry Editor Version
Line4: Copy second line of registry (*.reg) <<Blank Line
Line5: Copy third line of registry (*.reg) <<Registry key name
Line6: Copy forth line of registry (*.reg) <<Registry data values
Line7: __END <<end of createfile
Line8: blank line
Line9: delete tmfilter.reg <<Delete the file we are about to create for cleanup.
Line10: move __createfile tmfilter.reg <<The move command referencing createfile will create the file. This is also an opportunity to create the file in another directory.
Line11: waithidden regedit /s tmfilter.reg <<Silently executes registry file using regedit.
Createfile Example:
delete __createfile
createfile until __END
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TmFilter\Parameters]
“DebugLogFlags”=dword:0
__END
delete tmfilter.reg
move __createfile tmfilter.reg
waithidden regedit /s tmfilter.reg
Appendfile
Line1: delete __appendfile <<Always delete __appendfile prior to execution.
Line2: appendfile ‘copy first line of registry (*.reg) <<Registry Editor Version’
Line3: appendfile ‘Copy second line of registry (*.reg) <<Blank Line’
Line4: appendfile ‘Copy second line of registry (*.reg) <<Blank Line’
Line5: appendfile ‘Copy third line of registry (*.reg) <<Registry key name’
Line6: appendfile ‘Copy forth line of registry (*.reg) <<Registry data values’
Line7: blank line
Line8: delete tmfilter.reg <<delete the file we are about to create for cleanup
Line9: move __appendfile tmfilter.reg <<The move command referencing createfile will create the file. This is also an opportunity to create the file in another directory.
Line10: waithidden regedit /s tmfilter.reg <<silently executes registry file using regedit
Appendfile Example:
delete _appendfile
appendfile Windows Registry Editor Version 5.00
appendfile
appendfile [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TmFilter\Parameters]
appendfile “DebugLogFlags”=dword:0
delete tmfilter.reg
move __appendfile tmfilter.reg
waithidden regedit /s tmfilter.reg
-
Copy and test your actionscript via Custom Action on the test endpoint.
-
Decide whether this should be a Task for simple execution or a Fixlet if you plan on more advanced applicability and post-success criteria parameters.