How to get LAN ip to a variable in a Windows batch file

Posted by Ville Koskinen on Super User See other posts from Super User or by Ville Koskinen
Published on 2011-01-07T12:24:43Z Indexed on 2011/01/07 16:56 UTC
Read the original article Hit count: 266

Filed under:
|
|
|

I'm streaming audio from my Windows 7 laptop to a sound card attached to a router. I have a little batch script to start streaming.

REM Kill any instances of vlc 
taskkill /im vlc.exe
"c:\Program Files\VideoLAN\VLC\vlc.exe" <parameters to start http streaming>
REM Wait for vlc
TIMEOUT /T 10
REM start playback on router
plink -ssh [email protected] -pw password killall -9 madplay
plink -ssh [email protected] -pw password wget -q -O - http://192.1.159:8080/audio | madplay -Q --no-tty-control - &

As you see the http stream is hard coded. It would be nice to get the address dynamically to reuse the script on other machines. Any ideas?

© Super User or respective owner

Related posts about Windows

Related posts about batch