$scripts variable in drupal 6 adding unwanted script codes From where does the $scripts variable in drupal gets generated? I am getting an unwanted code generated in the html code like this

 &lt;script type="text/javascript" src="/js/js_01770598d5388f7cbcfe786a6df4ef2a.js"&gt;&lt;/script&gt;


I want to remove that code, for that I need to know the details about $scripts varialble used in tpl file
You should start at template_preprocess_node() where the $scripts variable is initialised:

$variables['scripts'] = drupal_get_js();


Then have a look at drupal_get_js() and follow the functions from there to find out how that mechanism works.

Then have a look at any implementations of hook_page_alter() throughout your site, where the $vars['scripts'] variable might be being manipulated.

Even though that technically answers your question, I'd be surprised if you find what you're looking for there. I've never heard of any malware that specifically targets Drupal (which is what this would be if it's manipulating the $scripts variable).

I'd check the rest of your page source to see if there's some JS being injected somewhere which is adding that &lt;script&gt; tag to the &lt;head&gt; dynamically, just in case.