Alright, i have been trying for a while now to do the following, i have googled up and down, searched this forum and the like. I have a .bat file that i created to help me convert my music. The problem i have is the .bat file calls an .exe and sends it several parameters. Here is an exerpt of it: ~~~~ If ~%1 == ~ GOTO end C:\Music\Lame_Encoder\lame.exe -b 320 -F -h %1 "%~d1%~p1%~n1 - 320.mp3" ~~~~ What this does in windows is checks to see if parameter 1 (usually a file i drag-n-dropped onto the .bat file) exists [If ~%1 == ~ GOTO end] then, if it does exist, finds lame.exe [C:\Music\Lame_Encoder\lame.exe] and then the options for lame [-b 320 -F -h] and finally the file to convert [%1] and converted file name ["%~d1%~p1%~n1 - 320.mp3"] (prior meaning ~Drive~\~PathofOriginalFile~\~NameofOriginalFile~ - 320.mp3) This works excellent in windows, i just drag over several files and it outputs .mp3's to the original file's folder. This does NOT work so well with wine. For various reasons i need to use this .bat and .exe file (mainly for file consistency between linux and windows). The end game i want it to be able to goto the command promt, drag-n-drop the .bat file over to it, then drag the files i want to convert to the promt as well. The lame.exe and .bat file are currently in my '/home/~username~/.wine/drive_c/Music/Lame_Encoder/' folder, so the bat file should be looking in the right place. One thing i have found to work is opening a terminal and drag-n-droping the lame.exe file, typing -b 320 -F -h then draging the .wav file from a different directory over. The command looks like this... '/home/~username~/.wine/drive_c/Music/Lame_Encoder/lame.exe' -b 320 -F -h '/home/~username~/Desktop/311 - Amber.wav' that outputs exactly like i want, one mp3 in the directory '~/Desktop' named '311 - Amber.mp3' can anyone help me create a working .bat or other script so i can send more than one file with the options '-b 320 -F -h' to the lame.exe so i can setup a few files to convert and walk away? Thanx for anyone who tries to help! PS yes its a long post, but i would rather people post like this so i know all the factors then a post that really vague and i have to ask a bunch of basic questions
GamezR2EZ wrote:> Alright, i have been trying for a while now to do the following, i have googled up and down, searched this forum and the like. > I have a .bat file that i created to help me convert my music. The problem i have is the .bat file calls an .exe and sends it several parameters. Here is an exerpt of it: > > Code: > > If ~%1 == ~ GOTO end > C:\Music\Lame_Encoder\lame.exe -b 320 -F -h %1 "%~d1%~p1%~n1 - 320.mp3" > > >Don't waste your time on neutered "shell scripting". Use the real thing: Code: #!/bin/bash [[ -f "$1" ]] && lame -b 320 -F -h "$1" "$HOME/Desktop/$(basename ${1%%.*}).mp3" This of course assumes you did install lame package.
vitamin wrote:> > > This of course assumes you did install lame package.which i stated i did not AND i needed to use the exe (it has a few modifications since its original source)
GamezR2EZ wrote:> Alright, i have been trying for a while now to do the following, i have googled up and down, searched this forum and the like. > I have a .bat file that i created to help me convert my music. The problem i have is the .bat file calls an .exe and sends it several parameters. Here is an exerpt of it: > > ~~~~ > If ~%1 == ~ GOTO end > > > > C:\Music\Lame_Encoder\lame.exe -b 320 -F -h %1 "%~d1%~p1%~n1 - 320.mp3" > > > ~~~~ >1. Is lame.exe a Windows executible? 2. If the answer to 1 is NO use DOSBOX. 3. If the answer to 2 is YES use: code: wine `C:\Music\Lame_Encoder\lame.exe -b 320 -F -h %1 "%~d1%~p1%~n1 - 320.mp3"` This will invoke wine to run the Windows Lame executable. This should be done for each conversion. The problem with running a .bat file is that this is DOS speak. Using a bash shell script is what Linux is looking for and it does work. James McKenzie
James McKenzie wrote:> GamezR2EZ wrote: > > > Alright, i have been trying for a while now to do the following, i have googled up and down, searched this forum and the like. > > I have a .bat file that i created to help me convert my music. The problem i have is the .bat file calls an .exe and sends it several parameters. Here is an exerpt of it: > > > > ~~~~ > > If ~%1 == ~ GOTO end > > > > > > > > C:\Music\Lame_Encoder\lame.exe -b 320 -F -h %1 "%~d1%~p1%~n1 - 320.mp3" > > > > > > ~~~~ > > > > > 1. Is lame.exe a Windows executible? > > 2. If the answer to 1 is NO use DOSBOX. > > 3. If the answer to 2 is YES use: > code: > wine `C:\Music\Lame_Encoder\lame.exe -b 320 -F -h %1 "%~d1%~p1%~n1 - > 320.mp3"` > > This will invoke wine to run the Windows Lame executable. This should > be done for each conversion. > > The problem with running a .bat file is that this is DOS speak. Using a > bash shell script is what Linux is looking for and it does work. > > James McKenziehi James batch files may have their history rooted in DOS, but they are very much a part of modern windows, supported by cmd.exe Those parameters %1 %~1d11% etc... are part of the batch programming language, you can't just pass them to lame.