tempman Posted May 8, 2008 Posted May 8, 2008 Hi, these are a batch command for changing IP and Subnet mask netsh int ip delete address name = "Local Area Connection" gateway = all netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm% and these for changing IP, Subnet mask and Gateway netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm% gateway = %vargw% gwmetric = 1 these are variables %varip% ----> $varip %varsm% ----> $varsm %vargw% ----> $vargw I nead it in AutoIt3 script separately RunWait(@ComSpec & " /c...
tempman Posted May 8, 2008 Author Posted May 8, 2008 I figure it out second one: netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm% gateway = %vargw% gwmetric = 1 RunWait(@ComSpec & " /c " & '"netsh int ip set address name = "Local Area Connection" source = static addr = "' & $varip & '" mask = "' & $varsm & '" gateway = "' &$vargw & '" gwmetric = 1"',"",@SW_SHOW) My enigma is first one because for two lines... netsh int ip delete address name = "Local Area Connection" gateway = all netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm%
Zedna Posted May 8, 2008 Posted May 8, 2008 RunWait(@ComSpec & " /c " & 'netsh int ip set address name = "Local Area Connection" source = static addr = "' & $varip & '" mask = "' & $varsm & '" gateway = "' &$vargw & '" gwmetric = 1',"",@SW_SHOW)oÝ÷ Ú¥¥êèæ®¶se'VåvB6öÕ7V2fײgV÷C²ö2gV÷C²fײb33¶F"gV÷C¶3¢b3#·6öÖR7V&F"b3#²gV÷C²b33²ÂgV÷C²gV÷C²Ä5uõ4õr Resources UDF ResourcesEx UDF AutoIt Forum Search
tempman Posted May 8, 2008 Author Posted May 8, 2008 Thanks But obviously am slow... I nead these two lines to convert in AutoIt script @ComSpec command In *.bat they execute one by one in same Command Promt... netsh int ip delete address name = "Local Area Connection" gateway = all <- ENTER netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm% <- ENTER
Zedna Posted May 8, 2008 Posted May 8, 2008 I nead these two lines to convert in AutoIt script @ComSpec command In *.bat they execute one by one in same Command Promt... netsh int ip delete address name = "Local Area Connection" gateway = all <- ENTER netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm% <- ENTER Just use two RunWait() for each netsh pseudocode: RunWait(netsh int ip delete ...) RunWait(netsh int ip set ...) Resources UDF ResourcesEx UDF AutoIt Forum Search
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