Page 1 of 1 1
Topic Options
#209852 - 2015-01-19 05:20 AM Change MTU?
GAW Offline
Fresh Scripter

Registered: 2010-02-16
Posts: 20
Loc: Tennessee
I am trying to set the MTU value on Windows 7 - I saw this in the forums but it doesn't work - was it only for Win XP?

 Code:
Break On
Dim $BaseKey, $Key, $RC, $MTUvalue

; Edit MTU value below.

$MTUvalue = '1400'
$BaseKey = 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces'


For each $Key in ArrayEnumKey($BaseKey)
$RC = WriteValue($BaseKey+'\'+$Key,'MTU', $MTUvalue ,'REG_DWORD')
Next



;UDF Functions Do Not Edit!
;UDF Function ArrayEnumKey

function arrayenumkey($regsubkey)
    dim $retcode, $subkeycounter, $currentsubkey, $subkeyarray
    
    if not keyexist($regsubkey)
        $arrayenumkey=''
        return
    endif
    
    $subkeycounter=0
    do
        $currentsubkey=enumkey($regsubkey,$subkeycounter)
        if $currentsubkey<>259 and @ERROR=0
            redim preserve $subkeyarray[$subkeycounter]
            $subkeyarray[$subkeycounter]=$currentsubkey
            $subkeycounter=$subkeycounter+1
        endif
    until $currentsubkey=259 or @ERROR
    
    $arrayenumkey=$subkeyarray
endfunction

;End UDF Functions.


I know I can run this command but I cannot get it to work in the script... I am probably missing something simple.

netsh interface ipv4 set subinterface "local area connection" mtu=1200 store=persistent

I am in a tight spot and need this to work! Hope someone on can help...

Thanks
Glenn


Edited by Mart (2015-01-19 09:28 AM)
Edit Reason: Please use code tags when posting code.

Top
#209853 - 2015-01-19 05:57 AM Re: Change MTU? [Re: GAW]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
are you by any chance trying this on 64bit windows without issuing alternativeregview?
_________________________
!

download KiXnet

Top
#209855 - 2015-01-19 06:14 AM Re: Change MTU? [Re: Lonkero]
GAW Offline
Fresh Scripter

Registered: 2010-02-16
Posts: 20
Loc: Tennessee
Sorry, I looked back and realized this was on win 2000... so I removed my post and created a new thread.

But I have a mix of win 7 32 and 64 bit...

Top
#209901 - 2015-02-02 07:06 AM Re: Change MTU? [Re: GAW]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Not sure related at all but ran across this tonight from MS

http://blogs.technet.com/b/askpfeplat/ar...er-2012-r2.aspx

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.063 seconds in which 0.033 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org