3

I've been searching for how to make some files on my USB drive open in an application in the same drive, but to no avail.

Is there any way to do this with or without adding some external files?

The file types I am talking about are video files (mp4 extension), and I am just trying to open them in a video player that is inside the USB (it's a portable version).

1
  • 2
    Based on your comments below, you should edit your question to clarify that you are looking for a solution that will work no matter what computer your plug your drive into. – Nick2253 Nov 10 '14 at 17:30
6

If you write a batch file that points to your application, you can use %~d0 in the batch file to get the drive where the batch file resides. For instance you could create a playvideo.bat, containing just %~d0/PortableApps/VLC/VLCPortable.exe %~d0/Media/video.mp4

13

Yes you can do this, the steps are below, my screenshots use the portable version of VLC.

  1. Right click on the mp4 file, and choose open with.

  1. Uncheck the box for "Always use the selected program to open this kind of file", and then browse.

  1. In the browse dialogue navigate to your portable application's exe file, click on it, and choose open.

  1. In the open with dialogue click on the newly listed protable application, and then click OK. The file will open in that program, and start playing.

Since you did not check the box for always using that program you cannot double click an mp4 to open it in that program, you will always have to use the open with menu, but that portable application will now be listed in your open with menu so the process will be easier to re-peat; just right-click, open with, and it should list your program right there as an option, choose it, and it will open the desired file in that program.

2
  • 2
    Thank you but i already know how to do this, i am talking about always opening it from the usb, as in in any other computer, the steps provided are saved in the pc registry and have to be done again in another computer EVEN if i ticked the "always open using this program". – Omarrrio Nov 9 '14 at 21:35
  • 7
    @Omarrrio saving stuff into the registry from a flash drive is a no-no, however you could setup a .bat file that opens the file with a relative path executable player – user2813274 Nov 10 '14 at 0:15
7

The simplest way would just be to either drag the file over the .exe of the media player and drop it, or, if it's buried in it's own folder, make a shortcut to it inside the folder where your media files are and drag/drop them. The shortcut should update the drive letter automatically so it will work on any (windows) computer.

1

You can write a program and register the file types with that program. In the program do whatever analysis of the file name passed as the argument, such as determining the path of the file. You can look up what programs are available in the registry or on the USB. That's how I would do it.

1

There was a virus few years ago that used an autorun.inf (thanks ComFreek) file on USB drives to "auto-run" a file on it. This exploit was used to run the virus, but you can use it to run the video player.

Here is a step-by-step guide on how to create one: http://www.instructables.com/id/Autorun-anything-off-of-a-usb-key/

I'm afraid it's not possible to associate a specific file format to the external program automatically. You'll have to associate the files on every machine you want this behaviour.

1
  • 1
    It's called Autorun.inf, but this feature is disabled unless you activate it yourself. – ComFreek Nov 10 '14 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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