Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
1  
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
add comment

6 Answers

up vote 6 down vote accepted
+50

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
add comment

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
add comment

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
add comment

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.