How do I change the temporary directory without using any administrative pages provided by Drupal?
In Drupal 7 the temporary path is stored in the variable file_temporary_path, so you can either update the entry in the variables table with a SQL-query. Or you can use Drush:

drush vset file_temporary_path [some_new_path].