I just copied the below code from --> https://stackoverflow.com/a/5901991/4251338
@echo off
set ip_address_string="IPv4 Address"
rem Uncomment the following line when using older versions of Windows without IPv6 support (by removing "rem")
rem set ip_address_string="IP Address"
echo Network Connection Test
for /f "usebackq tokens=2 delims=:" %%f in (`ipconfig ^| findstr /c:%ip_address_string%`) do echo Your IP Address is: %%f
Its printing the couple of IP addresses which is on my machine:
Your IP Address is: xxx.xxx.xxx.100
Your IP Address is: xxx.xxx.xxx.174
But actually I want to connect / mount the following IP address as well as
net use P: /del /yes
net use P: \\xxx.xxx.xxx.xxx\d$\testing
\\xxx.xxx.xxx.xxx\d$\testing (Which is available network IP)
Now the network should be like this: P:\Testing
.
Could you someone help me on this one. Thanks in advance.