Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to set default parameters for an application in Windows XP? (without using a shortcut) For example, I want Firefox to run with the parameters "-p username" when I run "firefox.exe".

share|improve this question
How do usually you start Firefox? Direct from the install directory or via shortcut or batch file? – Umber Ferrule Jul 27 '09 at 8:06
I start using a shortcut. An example problem here is that I can't associate ".htm" files with a shortcut, they can only be associated with an executable file. – swamplord Jul 27 '09 at 22:06
up vote 6 down vote accepted

Run regedit and take a look at the key:

`My Computer\HKEY_CLASSES_ROOT\FirefoxHTML\shell\open\command`

Put -p username into the command string at the appropriate place.

I believe this affects all users on the machine, however.

You would also be wise to backup this part of the registry. In RegEdit, select the key:

 `My Computer\HKEY_CLASSES_ROOT\FirefoxHTML`

and choose File | Export.... Choose the Selected Branch option to backup this part of the registry before changing it.

share|improve this answer

You can specify default parameters for any file (for example HTML files). Just:

  1. Open My Computer
  2. From Tools select Folder Options
  3. Go to File types tab
  4. Find the file type you want (HTM or HTML or both!)
  5. Click on Advanced button
  6. Select open action from actions list
  7. Click on Edit
  8. Add any parameter you want in text-box labled Application used to perform action:
  9. Click on OK and OK and then Close

Now when user opens a HTM or HTML file, firefox (or any application that is associated to HTM or HTML files) will run by the specified parameters and opens that file.

But as far as i know, there is no way to specify a default parameter for a particular EXE when user clicks on it.

share|improve this answer

You could just create a batch file that runs Firefox with the arguments, and always use this to run, by adding the Firefox directory to your PATH environmental variable and simply calling run.bat

share|improve this answer
That's what linux distributions do! That's why you see compiz.real as executable, for example. – LiraNuna Sep 9 '09 at 22:57

1) Open notepad, paste this in, and save it as firefox.bat

@echo off
firefox-original.exe -p username %*

2) Using a batch file compiler (such as this one or this one which both seem to do what you need, but note that I have not personally tested either), compile firefox.bat to firefox.exe

3) Navigate to your Firefox install directory, and rename firefox.exe to firefox-original.exe

4) Copy and paste your compiled batch file, firefox.exe, to your Firefox install directory.

Now when firefox.exe is launched, either directly, by shortcut, or by associated file type, your compiled batch file will run firefox-original.exe with your custom parameters and with the parameters passed during launch.

share|improve this answer
I tried this and unfortunately it doesn't work when I try to open html files with the compiled firefox.exe. – swamplord Sep 10 '09 at 9:22
Also, it will break every time you update firefox? – Stefan Thyberg Sep 10 '09 at 10:20
I am not sure about that, because I think "firefox-original.exe" will be updated everytime. – swamplord Sep 10 '09 at 10:54
It probably will break, but this is a pretty wacky hack so it's not unexpected – Factor Mystic Sep 10 '09 at 17:07

Always use the same shortcut for Firefox? It's not, to my knowledge, possible to set this on a per-application basis, just per-shortcut.

share|improve this answer
Will not work when opening HTML files, for example. – LiraNuna Sep 9 '09 at 22:57
That's completely correct. – Stefan Thyberg Sep 10 '09 at 10:18

An alternative to using a batch file compiler is to use an AutoIt script, which can be compiled into an exe file.
As has already been discussed here, you will have to rename the executable and replace it with the compiled script, which has its disadvantage when the executable is updated.

share|improve this answer

Had to do this to open Dia in integrated mode. Open regedit and find your extention in HKEY_CLASSES_ROOT. In my case .dia has 'dia_auto_file' as value.

HKEY_CLASSES_ROOT > .dia = dia_auto_file

Find that value inside HKEY_CLASSES_ROOT. Open up this value all the way until 'command':

HKEY_CLASSES_ROOT > dia_auto_file > shell > open > command

Here you can edit the command line like:

"F:\Portable\Dia\bin\diaw.exe" "%1"


"F:\Portable\Dia\bin\diaw.exe" "%1" --integrated

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.