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.

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

1 Answer 1

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

 
discard

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