Pine99 Posted March 16 Share Posted March 16 Hello There, Can someone please give an example how to do the below from AutoIT? Start command prompt to CD to a specific path, from that specific path to start an executable with parameters. e.g. CMD > CD "C:\Program Files\MusicPlayer" CMD > MusicPlayer.exe "FirstParameter-SongDirectory" "SecondParameter-SongName" "ThirdParameter-StartPlayingFromSconds" = MusicPlayer.exe "C:\Program Files\MusicPlayer\SongSelections" "Michael Jackson - Smooth Criminal.mp3" "10" Thank you! Link to comment Share on other sites More sharing options...
Solution Danp2 Posted March 16 Solution Share Posted March 16 Why the command prompt requirement? Have you tried using Run()? WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
abberration Posted March 17 Share Posted March 17 Personally, I would prefer ShellExecute because of the "parameter" parameter. ShellExecute("MusicPlayer.exe", "C:\Program Files\MusicPlayer\SongSelections\Michael Jackson - Smooth Criminal.mp3 10") But if you really want to run it from command line, I think this would do it. Run("cmd") WinWaitActive("C:\Windows\SYSTEM32\cmd.exe") Send('MusicPlayer.exe ' & '"' & 'C:\Program Files\MusicPlayer\SongSelections\Michael Jackson - Smooth Criminal.mp3 10' & '"') Send("{ENTER}") Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
TimRude Posted March 17 Share Posted March 17 12 hours ago, Pine99 said: CMD > CD "C:\Program Files\MusicPlayer" CMD > MusicPlayer.exe "FirstParameter-SongDirectory" "SecondParameter-SongName" "ThirdParameter-StartPlayingFromSconds" = MusicPlayer.exe "C:\Program Files\MusicPlayer\SongSelections" "Michael Jackson - Smooth Criminal.mp3" "10" Maybe this? ShellExecute('MusicPlayer.exe', '"C:\Program Files\MusicPlayer\SongSelections" "Michael Jackson - Smooth Criminal.mp3" "10"', 'C:\Program Files\MusicPlayer') Link to comment Share on other sites More sharing options...
Pine99 Posted March 17 Author Share Posted March 17 15 hours ago, Pine99 said: Hello There, Can someone please give an example how to do the below from AutoIT? Start command prompt to CD to a specific path, from that specific path to start an executable with parameters. e.g. CMD > CD "C:\Program Files\MusicPlayer" CMD > MusicPlayer.exe "FirstParameter-SongDirectory" "SecondParameter-SongName" "ThirdParameter-StartPlayingFromSconds" = MusicPlayer.exe "C:\Program Files\MusicPlayer\SongSelections" "Michael Jackson - Smooth Criminal.mp3" "10" Thank you! Thank you (and for everyone else who replied) I managed to do it (had to play around with the quotation marks a bit but it's working) e.g. $runMPE = Run('"C:\Program Files\MusicPlayer\SongSelections\MusicPlayer.exe" "Michael Jackson - Smooth Criminal.mp3" "10"') 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