Question: Surely this is a common use-case... I would have thought? Underneath "Add new comment" heading I would like to add a block of text like "Comments are pre-moderated and may be edited before publication". I have an internationalised site so the text must be translatable.

Answer: 
I would not re-create what the form does by hand as @Ayesh does. There is a small chance this form will do more things in a future minor drupal release date (maybe that should never happen, i'm not 100% sure).

What you want to do is look at [drupal\_form\_submit()](http://api.drupal.org/api/drupal/includes!form.inc/function/drupal_form_submit/7) to programmatically submit a form -- its like visiting the form in a webpage and submitting it without ever opening a browser window. Whatever logic that form does upon submission -- will still happen, eg. create an .htaccess file for you.

You would put the following code into your module install() hook, or you could `drush ev` this code or make a small php script and run `drush php-script myscript.php`

Code:

```
$form_state = array();
$form_state['values']['file_private_path'] = 'sites/default/files/private';
$form_state['values']['op'] = t('Save configuration');
drupal_form_submit('system_file_system_settings', $form_state);

```

You can then re-submit the form and set the default file serve mode from public to private. Or I would use `drush vset` or just `variable_set` somewhere in PHP to set the default file serving mode in drpual. My point is that this is the correct way to programmatically submit a form.
variable\_set() simple saves the value to the database and clear internal cache. Nothing else. 

So, before setting the value, you must verify that path is writable and prepare it (.htaccess stuff).

```
<?php
$path = 'sites/default/files/private';
if (is_dir($path) && is_writable($path)){
  file_create_htaccess($path); // for private dir. Use file_create_htaccess($path , FALSE); for public dir.
  variable_set('file_private_path',$path);

}

```

you can also drupal\_mkdir() and drupal\_chmod() $path if you want to make sure it's writable.