1

I let say I have some files with the following file extension .abc as you know it is possible to set default program to open these files. I was wondering, is it possible to set the default program for a file to be a BAT file (so far it is possible) and when ever I click it get as a parameter the name of the .abc file which associated with it.

I couldn't find anything related on google, thought you might have a clue.

1 Answer 1

0

This is hardly programming related, but anyways...

First create a batch file that somehow processes its first input parameter %1 as the file name of the file you clicked will be passed as the first parameter. Something simple like:

@ECHO OFF
ECHO %1
PAUSE

You then need to register your batch program to the file extension you like (e.g. .abc). A simple introduction how this is done can be found here.

Hope that helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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