Khryus Posted March 10, 2012 Share Posted March 10, 2012 Hello, How would you have VLC or WMP (windows media player) to open a video file via autoit? Would you use Run? Thanks in advance "The story of a blade is linked in Blood." ―Yasuo Link to comment Share on other sites More sharing options...
czardas Posted March 10, 2012 Share Posted March 10, 2012 Try ShellExecute() operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Khryus Posted March 10, 2012 Author Share Posted March 10, 2012 (edited) I don't know how to use ShellExecute to work with VLC or WMP, also, shouldn't the script/executable be inside VLC's or WMP's folder to work? I've got to go now, I'll check this tomorrow. Thanks for the help in advance Edited March 10, 2012 by megablox "The story of a blade is linked in Blood." ―Yasuo Link to comment Share on other sites More sharing options...
czardas Posted March 10, 2012 Share Posted March 10, 2012 (edited) ShellExecute() will open a media (or other type of) file using the default program. If you want to select a different program then it wouild require more code. You don't need to put the script inside any particular folder, but you do have to give the full path of the file you want to open (in this case the path to the media file). Edited March 10, 2012 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Khryus Posted March 11, 2012 Author Share Posted March 11, 2012 (edited) Thanks, it's working! But I need to make it so that you can choose which program you want to open the file with, so could you tell me what I have to do in order to do that? (don't need code, just some tips on how to do that) Edited March 11, 2012 by megablox "The story of a blade is linked in Blood." ―Yasuo Link to comment Share on other sites More sharing options...
hawkair Posted March 11, 2012 Share Posted March 11, 2012 (edited) Hi I have not much experience but for me this seems to work $vlc = "C:Program FilesVideoLANVLCvlc.exe" $kmp = "C:Program FilesThe KMPlayerKMPlayer.exe" $file = "d:My Moviesafterschool.xvid-lpd.avi" $file = " """ & $file & """" ;because of the blanks in the path Run ($vlc & $file ) Run ($kmp & $file ) Exit Edited March 11, 2012 by hawkair Link to comment Share on other sites More sharing options...
Chimaera Posted March 11, 2012 Share Posted March 11, 2012 Is there a reason that you need a different program to open it? ShellExecute() uses whatever the default option is that is set in windows, which is usefull when your intended target prefers one program over another If its just for yourself just right click a movie file and choose open with, check the set as default box and choose the program you want, then just use ShellExecute() and it will always use that program. If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
Throne3d Posted March 11, 2012 Share Posted March 11, 2012 Right, I managed to help MegaBlox. He wanted to be able to select in his AutoIt GUI which player, because... he's awkward. xD He was using a bit of ugly hax to do it, and basically created a cmd.exe window, then wrote the command into there, but I changed that to a ShellExecute method for him, and managed to make it work for VLC by doing a third argument, the working directory ("C:Program Files (x86)VideoLANVLC"). The second bit, the arguments with which to run the program, I looked at advanced methods of running VLC and found out you could specify a file there, as with WMPlayer, and you could also do fullscreen. So yeah, I think this is all fine now. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now