|
Answer» Hi all!
I'm very new in this domain and I absolutely don't know where and what to search regarding my problem :
I would like to locate the place of an installed program. For example, when you double-clic on a DOC document, it will open Word. But as far as I know, after double-clic, Windows doesn't check the entire harddisk to find the place of Microsoft Word. It should know its place, in the registry or something, or am I wrong ?
The point is, I would like a test.bat that, when it's executed, opens automatically a video with VLC, even if VLC if not the default player.
I have everything working, but I have the path to VLC written inside the FILE. So if someone install it elsewhere, it will not work.
So I found a way to look over the whole harddrive, but if it's full of GigaBit, it takes a lot of time to find the place.
Is there a way to know quickly the path to a program ?
thanks rekamWhy not just place a shortcut on the desktop and/or the start menu. Then there would be no NEED to search the drive and the program would be readily available.Yes, and then you can just drag and drop the media file on to the shortcut. I don't know how easy it would be to search through the entire registry for your VLC's install folder, I don't know if it even records it there, I suppose it does.
If you still want to go your way. Perhaps in your batch file you could check if VLC is in the default location, and if not then explain this and ask them to RECTIFY it. OR if that is not an option, ask them to type in the location of the VLC exe the first time they open the .bat file. Save this variable to a txt file, (attrib +h +s) it and then read its contents back into the variable the next time(s). (set /p vlcloc=<%cd%\vlclocation.txt).Okay, thanks, I would choose the second solution, because I'm working on a CD and I open the .bat file from the CD. This bat should find VLC and launch automatically the video (also on the CD) in fullscreen mode.
The thing is, when you right-clic on a file and choose "open with" and then select a program, Windows knows where they're all installed, no ? No only the ones by default.
There should be a way to do the same thing ?
thanks again rekamASSOC .ext : shows the file type associated with the extension given
FTYPE filetype : shows the command string attached to that type of file
so, putting it together
for /F "tokens=1,2 delims==" %A in ('assoc .txt') do ftype %B
will show (something like) txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1
[edit] just reread your question ... VLC might not be the default player -- it might not even be installed !!
why not install the player in the place you expect it as part of your process ? Grahamussually, if a program installed it will set path theit automatic.. so you just type Start "file to open with" i.e.:Start VLC.exe "C:\sample.doc"
you can get InstalledPath of your Program in Registry: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths find subkey called VLC.exe or similar and view the "Path" string value in right side.. ex:Path REG_SZ "c:\ProgramFiles\VLC\vlc.exe"Quote from: Fen_Li on JULY 20, 2007, 11:54:12 AM so you just type Start <Program-name> "file to open with" i.e.:Start VLC.exe "c:\sample.doc"
Be careful when using the START command with quotes. The first set of quotes will be the window title, so I don't think you will get the results you are expecting.
|