Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

how can I change print settings in firefox using vbscript?

  • 8 replies
  • 2 have this problem
  • 36 views
  • Last reply by jirohshem
  • Solved

I need to create a script to set default settings for printing in firefox with no header or footer and all the margins to 0. Please help, so that I can use it for deployment. Thanks

I need to create a script to set default settings for printing in firefox with no header or footer and all the margins to 0. Please help, so that I can use it for deployment. Thanks

Chosen solution

Once you know what the necessary lines are, you can use FileSystemObject methods to append them to a user.js file in the user's profile(s). You'll have to discover the lines interactively, but for example:

user_pref("print.printer_Adobe_PDF.print_margin_bottom", "0"); user_pref("print.printer_Adobe_PDF.print_margin_left", "0"); user_pref("print.printer_Adobe_PDF.print_margin_right", "0"); user_pref("print.printer_Adobe_PDF.print_margin_top", "0");

Read this answer in context 👍 1

All Replies (8)

AFAIK if you did a once print with those options removed the future prints will have those removed.

That is if you will set it on on pc. But I need something to be used for other pc for deployment

Some print setting can be set via prefs on the about:config page or possibly via auto-config. I don't know if the setting that you mean fall in this category, so you will have to check this out yourself.

cor-el said

Some print setting can be set via prefs on the about:config page or possibly via auto-config. I don't know if the setting that you mean fall in this category, so you will have to check this out yourself.

thanks but, I tried this but the settings for printing does not apply. I just need to have atleast the command for vbscript for me to change print settings in firefox for no header and footer and all margins to 0.

Did you check the prefs.js file in your profile folder to see what commands got added when you made interactive changes in the Page Setup dialog? They may be printer-specific.

If you don't use Autoconfig, your VBScript will need to discover the current user's profile folder(s) under %APPDATA%\Mozilla\Firefox\Profiles to add or edit a user.js file with the necessary commands. The user.js file is only read at Firefox startup, so you can't use VBScript to make dynamic changes during the session. http://kb.mozillazine.org/User.js_file

jscher2000 said

Did you check the prefs.js file in your profile folder to see what commands got added when you made interactive changes in the Page Setup dialog? They may be printer-specific. If you don't use Autoconfig, your VBScript will need to discover the current user's profile folder(s) under %APPDATA%\Mozilla\Firefox\Profiles to add or edit a user.js file with the necessary commands. The user.js file is only read at Firefox startup, so you can't use VBScript to make dynamic changes during the session. http://kb.mozillazine.org/User.js_file

I see, is there any script that I can use so I can use it for other pc to copy the settings ?

Chosen Solution

Once you know what the necessary lines are, you can use FileSystemObject methods to append them to a user.js file in the user's profile(s). You'll have to discover the lines interactively, but for example:

user_pref("print.printer_Adobe_PDF.print_margin_bottom", "0"); user_pref("print.printer_Adobe_PDF.print_margin_left", "0"); user_pref("print.printer_Adobe_PDF.print_margin_right", "0"); user_pref("print.printer_Adobe_PDF.print_margin_top", "0");

jscher2000 said

Once you know what the necessary lines are, you can use FileSystemObject methods to append them to a user.js file in the user's profile(s). You'll have to discover the lines interactively, but for example: user_pref("print.printer_Adobe_PDF.print_margin_bottom", "0"); user_pref("print.printer_Adobe_PDF.print_margin_left", "0"); user_pref("print.printer_Adobe_PDF.print_margin_right", "0"); user_pref("print.printer_Adobe_PDF.print_margin_top", "0");

Thanks that helps