Posts Tagged ‘Foreach’

HowTo: install multiple Corel Painter brushpacks silently

I got a nice expression software charity bundle with Corel Painter 2020 (current version is 2021) and a bunch of brushes in it and then noticed that the brush packs where available for download as separate installers than the Painter software.

So I launched one of the brush pack installers from the command-line (can give CMD and press enter at the address bar of the file explorer window to open command-line in the current folder) with a /? parameter to see its syntax:

e:\brushpack_abstract_windows.exe /?


Then I created a batch file to loop over all the brush_* installer files using the following commands in the console (press ENTER after each one). The for loop executes each brush pack installer from the same folder passing parameters for silent mode (/S /v/qn), as instructed by the dialog above:

copy con PainterInstallBrushes.bat
@for %%f in (brushpack_*) do %%f /S /v/qn


The last one (^Z) means Press CTRL+Z (then press ENTER for that line too). It signifies the end-of-file / input. We were inputing/copying keystrokes from the console (CON) into the file PainterInstallBrushes.bat (note that if the file exists you’re asked to overwrite it as soon as you copy the 1st line into it, but you still have to press CTRL+Z and ENTER to end input).

To avoid having to press Yes at repeated security dialogs (due to User Access Control [UAC] being activated), I opened an administrator command-prompt (can give CMD at Windows search and right click the found cmd.exe and select to open it as administrator), then executed the batch file (E: goes to drive E, CD \ goes to folder under E: drive root)

c:\windows\system32> e:
e:\somefolder> cd \
e:\> PainterInstallBrushes.bat


e:\>brushpack_abstract_windows.exe /S /v/qn

e:\>brushpack_alcoholink_windows.exe /S /v/qn

e:\>brushpack_bristly_windows.exe /S /v/qn

e:\>brushpack_bubbles_windows.exe /S /v/qn

e:\>brushpack_drytexture_windows.exe /S /v/qn

e:\>brushpack_feather_windows.exe /S /v/qn

e:\>brushpack_fireworks_windows.exe /S /v/qn

e:\>brushpack_gesturalillustration_windows.exe /S /v/qn

e:\>brushpack_mangaii_windows.exe /S /v/qn

e:\>brushpack_michellewebbmasterpack_windows.exe /S /v/qn

e:\>brushpack_nature_windows.exe /S /v/qn

e:\>brushpack_perfectpets_windows.exe /S /v/qn

e:\>brushpack_popart_windows.exe /S /v/qn

e:\>brushpack_rain_windows.exe /S /v/qn

e:\>brushpack_rake_windows.exe /S /v/qn

e:\>brushpack_rustandpatina_windows.exe /S /v/qn

e:\>brushpack_scrape_windows.exe /S /v/qn

e:\>brushpack_stipple_windows.exe /S /v/qn

e:\>brushpack_suminagashi_windows.exe /S /v/qn

e:\>brushpack_sunnyrays_windows.exe /S /v/qn

An alternative way to using the command-line would have been to create the batch (.bat) file with a text editor in the same folder as the brush pack installers, then right click it and select to run it as an administrator from the popup menu.

Suggestion: add optional “where” clause to “foreach” statement in C#

Wouldn’t it be nice if I could use in C# the following syntax?

for (SomeType repeaterVariable

      in SomeEnumerable

      where someBooleanExpressionOfRepeaterVariable)


e.g. use this one:


instead of this one:


BTW, if you wonder what FixTime does, it prepends 0: to time strings to make sure they are of format h:m:s.f

Have added this as a comment to another person’s suggestion that I see has similar format, so please vote for that one:

Categories: Posts Tags: , , , , ,
%d bloggers like this: