How to regset a list with a file

(imported topic written by bearandy91)

I have another question:

I have a list for disallowrun. And could I change the “1”=“notepad.exe”

“2”=“notepad.exe”

…etc

to a test.txt file direct add all .exe list?

Then if I change the list and I just have to change the file instead changing the relevance.

Action:

Createfile until end-reg-edit-commands

REGEDIT4

“1”=“notepad.exe”

“2”=“notepad.exe”

end-reg-edit-commands

delete setup.reg

move __createfile setup.reg

wait regedit /s setup.reg

(imported comment written by bearandy91)

I try to change the test.txt list content to “1”=“notepad.exe”

“2”=“AcroRd32.exe”

and to use “lines of file”. It’s not useful.

(imported comment written by NoahSalzman)

Here is a test I did that might help.

I ran this action

Createfile until end-reg-edit-commands
REGEDIT4 
[("HKEY_USERS\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun]
{concatenation "%0d%0a" of lines of file "c:\test.txt"}
end-reg-edit-commands
delete setup.reg
move __createfile setup.reg

and it produced this result:

REGEDIT4 
[("HKEY_USERS\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun]
"1"="foo.exe"
"2"="bar.exe"

The contents of file test.txt looks like this:

“1”=“foo.exe”

“2”=“bar.exe”

(imported comment written by bearandy91)

Thanks! It works!

(imported comment written by bearandy91)

I have a question about the list. We always have to save a list in client computer and search the file to write in. ex:lines of file “c:\test.txt” it is in client.

It seems couldn’t reference the list from the computer that installed console, right?

(imported comment written by NoahSalzman)

Yes, in general it’s assumed that the file is on the Client. However, anything is possible, you could write an Action that pulls down the latest list from a server (say, via HTTP) each time the action is run.

A more complicated approach would be to generate the Action programmatically – using the Platform API – so that the list was inserted into the Action automatically at the time that the Action was created.