Add js file in .info theme file. And set it to load first I added this line in my-theme.info

scripts[] = js/my-file.js


The files is loads but in last place. I need it to be loaded before all modules js files.

How can I set the weight?  

I also tried (same results) in template.php with:

function MY-THEME_preprocess_page(&amp;$variables) {

  $file =  path_to_theme() . '/js/my-file.js';
  $options = array('weight' =&gt; -1000);

  drupal_add_js($file, $options);

}
You can add the scope (header/footer) where to load the JS and also add a weight.

Example options:

$options = array('type' =&gt; 'file', 'scope' =&gt; 'header', 'weight' =&gt; 5));


Play around with these to get the file loaded on the right position that suits your needs. For more detailed information check the documentation.