![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Newbie alert! Although I've done much programming in the (distant) past I would appreciate five minutes of someone's time to help me get started with PowerShell. What I would like to do is pretty simple - Process each file in a directory using lame to produce a mp3 as follows lame -h -b 320 4RR_SYN69CD_track01.wav mp3\4RR_SYN69CD_track01.mp3 I'm not sure whether to try to get all the filenames in the directory and process them to produce a complete script to run against the directory or whether to try to process the files one at a time - could I do this starting with Get-ChildItem? Or am I looking at the wrong tool for the job? TIA - Martin |
| | #2 (permalink) |
| Guest | Re: Newbie alert! Assuming that you have lame.exe in the current directory and that you've already created the mp3 subfolder the following should work: gci *.wav | %{ $in = $_.Name; $out = [system.io.path]::ChangeExtension($in, "mp3"); ./lame -h -b 320 $in mp3/$out } //andrew Axolotl Q Cleaver wrote: > Although I've done much programming in the (distant) past I would > appreciate five minutes of someone's time to help me get started with > PowerShell. > > What I would like to do is pretty simple - > Process each file in a directory using lame to produce a mp3 as follows > lame -h -b 320 4RR_SYN69CD_track01.wav mp3\4RR_SYN69CD_track01.mp3 > > I'm not sure whether to try to get all the filenames in the directory > and process them to produce a complete script to run against the > directory or whether to try to process the files one at a time - could I > do this starting with Get-ChildItem? > > Or am I looking at the wrong tool for the job? > > TIA - Martin |
| | #3 (permalink) |
| Guest | Re: Newbie alert! This is slightly shorter: gci *.wav | %{ ./lame -h -b 320 $_.Name "mp3/$($_.Name -replace '\.wav$','.mp3')" } Andrew Savinykh wrote: > Assuming that you have lame.exe in the current directory and that you've > already created the mp3 subfolder the following should work: > > gci *.wav | %{ $in = $_.Name; $out = > [system.io.path]::ChangeExtension($in, "mp3"); ./lame -h -b 320 $in > mp3/$out } > > //andrew > > > Axolotl Q Cleaver wrote: >> Although I've done much programming in the (distant) past I would >> appreciate five minutes of someone's time to help me get started with >> PowerShell. >> >> What I would like to do is pretty simple - >> Process each file in a directory using lame to produce a mp3 as follows >> lame -h -b 320 4RR_SYN69CD_track01.wav mp3\4RR_SYN69CD_track01.mp3 >> >> I'm not sure whether to try to get all the filenames in the directory >> and process them to produce a complete script to run against the >> directory or whether to try to process the files one at a time - could >> I do this starting with Get-ChildItem? >> >> Or am I looking at the wrong tool for the job? >> >> TIA - Martin |
| | #4 (permalink) |
| Guest | Re: Newbie alert! TVM for both working examples - now I just have to figure out how they work!! I've added this to the beginning of the script: if (!(Test-Path MP3 -PathType Container)) { new-item -path . -name MP3 -type directory } The thing that remains to puzzle me is this: the path includes c:\windows\system32 which is where lame.exe and its associated .dll are kept - why does lame have to be in the current directory? Sorry to answer your helpful reply with another question! Best wishes - Martin Andrew Savinykh wrote: > This is slightly shorter: > > gci *.wav | %{ ./lame -h -b 320 $_.Name "mp3/$($_.Name -replace > '\.wav$','.mp3')" } > > Andrew Savinykh wrote: >> Assuming that you have lame.exe in the current directory and that >> you've already created the mp3 subfolder the following should work: >> >> gci *.wav | %{ $in = $_.Name; $out = >> [system.io.path]::ChangeExtension($in, "mp3"); ./lame -h -b 320 $in >> mp3/$out } >> |
| | #5 (permalink) |
| Guest | Re: Newbie alert! Axolotl Q Cleaver wrote: > The thing that remains to puzzle me is this: > the path includes c:\windows\system32 which is where lame.exe and its > associated .dll are kept - why does lame have to be in the current > directory? It doesn't. I didn't know that you have in on the path, so I assumed it's in the current folder. If it is on the path, just change './lame' to 'lame' - should work. |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New IM message alert | fs_fan | Live Messenger | 0 | 07-15-2008 11:13 AM |
| Alert Help Alert Alert Help Alert | this justin1 | Gaming | 2 | 04-07-2008 09:33 AM |
| New Mail Alert | Christopher | Live Mail | 2 | 03-14-2008 06:19 AM |
| New Newsgroups Alert? | Michelle | Vista mail | 2 | 01-29-2008 07:22 AM |
| Alert! - friends | Richard Urban | Vista General | 8 | 02-25-2007 02:33 PM |