StickyChopstix Posted June 24, 2018 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?
Subz Posted June 24, 2018 Posted June 24, 2018 (edited) You can't, any reason why you require quotes? Edited June 24, 2018 by Subz
StickyChopstix Posted June 24, 2018 Author 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
Subz Posted June 24, 2018 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)
StickyChopstix Posted June 24, 2018 Author 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
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