How can i paste the data stored from clip and use it for a different command

0

I need to paste the result of clip command into netsh interface ip address

FOR /F "tokens=*" %%i in ('ipconfig ^| find "IPv4"') do SET result=%%i
echo %result:IPv4 Address. . . . . . . . . . . : =% | clip
netsh interface ip set address name="Local Area Connection" static %clip% 255.255.255.0 192.168.1.1

user2586774

Posted 2013-07-16T10:24:27.597

Reputation: 11

You shouldn't duplicate your questions on both SU and SO, so delete one of the copies. – Karan – 2013-07-16T17:14:11.087

@karan will do though i thought they were two different networks – user2586774 – 2013-07-17T08:23:46.820

Answers

0

route change -p 0.0.0.0 mask 0.0.0.0 192.168.1.1

STTR

Posted 2013-07-16T10:24:27.597

Reputation: 6 180

what is the address you need to place after -p ? – user2586774 – 2013-07-17T10:07:41.883

0

setlocal

FOR /F "tokens=*" %%i in ('ipconfig ^| find "IPv4"') do SET result=%%i
SET result=%result:IPv4 Address. . . . . . . . . . . : =%
echo %result% | clip
netsh interface ip set address name="Local Area Connection" static %result% 255.255.255.0 192.168.1.1

endlocal

Vlastimil Ovčáčík

Posted 2013-07-16T10:24:27.597

Reputation: 1 835