open file with specific program

Hewlett-packard Pavilion dv6000 notebook...
March 21, 2010 at 09:17:11
Specs: Windows Vista

I am trying to create a batch file which i am
going to compile to an exe file

I want to right-click at a file and choose "open
with" and then choose my
exe file..
Then i want the exe file to find out what file i
just rightclicked and then start
it with a specific program.. I have found this
command which i believe would
do the trick: "start "title" "programpath"

I just have no idea how to specify filepath

Thank you in advance :)

See More: open file with specific program

Report •

March 22, 2010 at 04:00:39
When you perform a rightclick, the current path is "filepath", no ? Put a "cd" command in your initial batch-script, and see if that is correct. Either catch that one, or just check that you may not already have it, by means of the "set" command.

So, before you run "start", run:


Check the output

Report •

March 22, 2010 at 11:09:05
I'm afraid that it doesn't work.. cd is not the filepath and i've
checked the set variables over and over :p

But - almost all programs can be used with "open with" .. so - it
is possible to do somehow .. any ideas how to do it if we skip
batch ?

Report •

March 22, 2010 at 13:22:19
i tried it on mine and %1 gave me the full path and filename.

Report •

Related Solutions

March 23, 2010 at 08:15:18
I'm still not sure what the exact question is, but this is what I understand : you want to know the path of the exe which is being executed (and not the path of where the data file is located). Is that correct ?

I have a which.cmd which can tell where it found the EXE (or any other executable file) you were calling, but it's custom.

Report •

Ask Question