StickyChopstix Posted June 24, 2018 Share Posted June 24, 2018 $ipchange = 'netsh interface ipv4 set address "Local Area Connection" static ' $one = 192.168.1.124 $two = 255.255.255.0 $three = 192.168.1.1 Run(@ComSpec & $ipchange & $one & $two & $three) how would I go about using ip addresses in variables without using quotes? Link to comment Share on other sites More sharing options...
Subz Posted June 24, 2018 Share Posted June 24, 2018 (edited) You can't, any reason why you require quotes? Edited June 24, 2018 by Subz Link to comment Share on other sites More sharing options...
StickyChopstix Posted June 24, 2018 Author Share Posted June 24, 2018 (edited) the "netsh interface ipv4 set address" command doesn't work if the IP is set in quotes Edited June 24, 2018 by StickyChopstix Link to comment Share on other sites More sharing options...
Subz Posted June 24, 2018 Share Posted June 24, 2018 Yes I understand, but why can't you just use: $ipchange = 'netsh interface ipv4 set address "Local Area Connection" static ' $one = "192.168.1.124" $two = "255.255.255.0" $three = "192.168.1.1" ConsoleWrite("Run('" & @ComSpec & " /c " & $ipchange & $one & " " & $two & " " & $three & "')" & @CRLF) Link to comment Share on other sites More sharing options...
StickyChopstix Posted June 24, 2018 Author Share Posted June 24, 2018 ah, okay, I see what my problem was. I forgot to add those " " in-between the IPs and the " /c " and #requireadmin. Thanks @Subz Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now