FG
💻 Software

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

Fresh5 days ago
Mar 15, 202655176 views
Confidence Score0%
0%

Problem

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. 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?

Error Output

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
TIM…

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to get LAN ip to a variable in a Windows batch file

Low Risk

Here is a simple example that will get the ipv4 address of the current machine: This just echos out the IP but you can integrate it in. Or you can try this and not use temporary files:

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment