- Timestamp:
- 2016-11-14T21:33:12+13:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/bin/script/IPv4.bat
r30038 r31107 4 4 rem If passed -format-for-tomcat-context, it will echo the same with a pipe 5 5 rem symbol up front and all the . escaped with a "\". E.g. "|100\.200\.300\.45" 6 rem The 3 spaces in front of the IPv4 match expression ensure we grab the line 7 rem that starts with "IPv4 Address", not the many others containing "IPv4 Address". 8 rem Without the spaces, it will grab the last line mentioning "IPv4" (ethernet). 6 9 7 for /f "usebackq tokens=2 delims=:" %%a in (`ipconfig ^| find " IPv4"`) do (set result=%%a)10 for /f "usebackq tokens=2 delims=:" %%a in (`ipconfig ^| find " IPv4"`) do (set result=%%a) 8 11 9 12 :: To lop off the single extra space in front of IPv4 number, end with:
Note:
See TracChangeset
for help on using the changeset viewer.