I have this script
a=inputbox("Wat is het IP adres van de VPS?")
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "cmd.exe /C netsh interface ipv4 set address name=Wi-Fi source=static address="& a &" mask=255.255.254.0 gateway=185.18.148.1 & pause"
msgbox "IP adres: " +a
The user types his VPS IP address into the inputbox. The gateway is VPS IP.1 (for example 8.8.8.1 when VPS IP is 8.8.8.8)
I would like to read the IP variable (a) and delete all characters right from the third dot
Example 1: User types in 176.23.45.102 In this case, 102 should be deleted and the variable should be changed into 176.23.45.
Example 2: User types in 17.23.45.4 In this case, 4 should be deleted and the variable should be changed into 17.23.45.
If not possible in VBScript, (Windows) command line/batch is also good.