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

I have a very basic script, that looks something like

myProg -i INFILE >%TEMP%\INFILE.tmp
mySecProg -i %TEMP%\INFILE.tmp -o OUTFILE

How do I add this script to my contextmenu, such that the 'INFILE' is the file I've rightclicked, and how do make sure the OUTFILE will be in the dirname of the 'INFILE.

share|improve this question
up vote 0 down vote accepted

You can add items for a specific file type by selecting Tools -> Folder Options -> File Types -> Advanced and adding a new action.

If I look at the "open" entry for a .txt file I see "C:\WINDOWS\system32\NOTEPAD.EXE %1"; the "%1" passes the name of the file into the program script and can be accessed in your script by using the "%1" variable name rather than "INFILE". You would then have to do a wee bit of string manipulation to create your OUTFILE name - I seem to remember looking for the last "\" and deleting from that point in the past.

share|improve this answer

Your Answer


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