I need to run the following script on all inSync.cfg files under a directory called c:\inSync4\users.
powershell -Command “(get-content inSync.cfg) -replace ‘SYSTEM_PROXY = False’, ‘SYSTEM_PROXY = True’| set-content inSync.cfg”
I need to run the following script on all inSync.cfg files under a directory called c:\inSync4\users.
powershell -Command “(get-content inSync.cfg) -replace ‘SYSTEM_PROXY = False’, ‘SYSTEM_PROXY = True’| set-content inSync.cfg”
So you want someone to create an action script that performs this action?
Questions about looping come up frequently. While actionscript doesn’t support true loops, there is a way to emulate looping by using lists.
If I understand your question correctly -
You can try something like:
delete __appendfile
// Build the list of Powershell commands, concatenated with CR/LF characters to put each on a separate line
// The Powershell.exe command & static parameters are treated as string literals
// The pathname of the config files are substituted for ‘it’
appendfile {concatenation “%0d%0a” of (“powershell -Command %22(get-content %22” & it & “%22) -replace ‘SYSTEM_PROXY = False’, ‘SYSTEM_PROXY = True’| set-content %22” & it & “%22”) of pathnames of files “inSync.cfg” of folders of folders “c:\inSync4\Users”}
delete UpdateInSync.cmd
move __appendfile UpdateInSync.cmd
waithidden cmd /c UpdateInSync.cmd
Thank you Jason. This is perfect.