Code: Select all
[...]
WshShell\Invoke("Run 'netsh int tcp set global ecncapability=enabled'")
Debug COMate_GetLastErrorDescription()
[...]
Greetings ... Kiffi
Code: Select all
[...]
WshShell\Invoke("Run 'netsh int tcp set global ecncapability=enabled'")
Debug COMate_GetLastErrorDescription()
[...]
Code: Select all
Define WshShell.COMateObject
WshShell = COMate_CreateObject("WScript.Shell")
If WshShell
WshShell\Invoke("Run('netsh int tcp set Global ecncapability=enabled')")
WshShell\Release()
Else
Debug "!WshShell"
EndIf
Code: Select all
XIncludeFile "COMate.pbi"
XIncludeFile "VariantHelper_Include.pb"
; NETSH scripts for Windows Vista and Server 2008
; Changes take effect immediately - no reboot needed
; PureBasic 4.30 and COMate by srod
; By SFSxOI - December 2008
; ECN Capability - Ecn_EnableDisable(ecn_enbdis.s)
; where - ecn_enbdis.s is one of the following
; enable : some routers have issues with this enabled, not suggested and need to test first
; disable : this is the default state and recommended setting
; default : restores the system default
Procedure Ecn_EnableDisable(ecn_enbdis.s)
Define WshShell.COMateObject
WshShell = COMate_CreateObject("WScript.Shell")
If WshShell
If ecn_enbdis = "enable"
WshShell\Invoke("Run('netsh int tcp set Global ecncapability=enable')")
EndIf
If ecn_enbdis = "disable"
WshShell\Invoke("Run('netsh int tcp set Global ecncapability=disable')")
EndIf
If ecn_enbdis = "default"
WshShell\Invoke("Run('netsh int tcp set Global ecncapability=default')")
EndIf
WshShell\Release()
EndIf
EndProcedure
; TCP Auto-Tuning - TCP_Auto_Tune(auto_tune.s)
; where - auto_tune.s is one of the following
;normal : Default value, allows the receive window To grow To accommodate most conditions
;highlyrestricted : allows the receive window To grow beyond default value very conservatively
;restricted : somewhat restricted growth of the tcp receive window beyond its Default value
;disabled : uses a fixed value For the tcp receive window. Limits it To 64KB (limited at 65535).
;experimental : allows the receive window to grow to accommodate extreme scenarios
;NOTE: experimental setting not recommended, it can degrade performance in common scenarios, only intended For research purposes. It enables RWIN values of over 16 MB
; If you experience problems with your NAT router or SPI firewall, try the "restricted", "highlyrestricted", or even "disabled" state.
; recomended normal unless you are having problems
Procedure TCP_Auto_Tune(auto_tune.s)
Define WshShell.COMateObject
WshShell = COMate_CreateObject("WScript.Shell")
If WshShell
If auto_tune = "normal"
WshShell\Invoke("Run('netsh int tcp set global autotuninglevel=normal')")
EndIf
If auto_tune = "highlyrestricted"
WshShell\Invoke("Run('netsh int tcp set global autotuninglevel=highlyrestricted')")
EndIf
If auto_tune = "restricted"
WshShell\Invoke("Run('netsh int tcp set global autotuninglevel=restricted')")
EndIf
If auto_tune = "disabled"
WshShell\Invoke("Run('netsh int tcp set global autotuninglevel=disabled')")
EndIf
If auto_tune = "experimental"
WshShell\Invoke("Run('netsh int tcp set global autotuninglevel=experimental')")
EndIf
WshShell\Release()
EndIf
EndProcedure
; Compound TCP - Con_TCP(level_ctcp.s)
; where - level_ctcp.s is one of the following
; ctcp : recommended setting (default for Server 2008)
; none : no congestion control at all (default for Windows Vista)
; Default : restores the system default
; Recommended setting: ctcp
; It is better To use this newer generation CTCP congestion control algorithm For most broadband connections,
; NOTE: By default Vista has CTCP turned off (none), and Server 2008 has CTCP turned on (ctcp).
; NOTE : Turning this option on can significantly increase throughput (not bandwidth).
Procedure Con_TCP(level_ctcp.s)
Define WshShell.COMateObject
WshShell = COMate_CreateObject("WScript.Shell")
If WshShell
If level_ctcp = "ctcp"
WshShell\Invoke("Run('netsh int tcp set Global congestionprovider=ctcp')")
EndIf
If level_ctcp = "none"
WshShell\Invoke("Run('netsh int tcp set Global congestionprovider=none')")
EndIf
If level_ctcp = "default"
WshShell\Invoke("Run('netsh int tcp set Global congestionprovider=default')")
EndIf
WshShell\Release()
EndIf
EndProcedure
; RSS - Receive-side Scaling - Rss_Scale(scale_rss.s)
; where - scale_rss.s is one of the following
; enabled : Default - enables receive side scaling
; disabled : disables receive side scaling
; default : returns to system default
; Recommended: enabled (If you have 2 Or more processor cores And a NIC that can handle RSS)
Procedure Rss_Scale(scale_rss.s)
Define WshShell.COMateObject
WshShell = COMate_CreateObject("WScript.Shell")
If WshShell
If scale_rss = "enabled"
WshShell\Invoke("Run('netsh int tcp set global rss=enabled')")
EndIf
If scale_rss = "disabled"
WshShell\Invoke("Run('netsh int tcp set global rss=disabled')")
EndIf
If scale_rss = "default"
WshShell\Invoke("Run('netsh int tcp set global rss=default')")
EndIf
WshShell\Release()
EndIf
EndProcedure
; TCP Chimney Offload - TCP_Chimney_Offload(tcp_offload.s)
; where - tcp_offload.s is one of the following
; enabled : enables TCP Chimney Offload (Default)
; disabled : disables TCP Chimney Offload
; default : returns to default system default
; Recommended: enabled
Procedure TCP_Chimney_Offload(tcp_offload.s)
Define WshShell.COMateObject
WshShell = COMate_CreateObject("WScript.Shell")
If WshShell
If tcp_offload = "enabled"
WshShell\Invoke("Run('netsh int tcp set global chimney=enabled')")
EndIf
If tcp_offload = "disabled"
WshShell\Invoke("Run('netsh int tcp set global chimney=disabled')")
EndIf
If tcp_offload = "default"
WshShell\Invoke("Run('netsh int tcp set global chimney=default')")
EndIf
WshShell\Release()
EndIf
EndProcedure
; Time Stamp 1323 - TimeStamp_1323(time_stamp.s)
; where - time_stamp.s is one of the following
; enabled : Time Stamp 1323 enabled (recommended for most)
; disabled : Time Stamp 1323 disabled (default)
Procedure TimeStamp_1323(time_stamp.s)
Define WshShell.COMateObject
WshShell = COMate_CreateObject("WScript.Shell")
If WshShell
If time_stamp = "enabled"
WshShell\Invoke("Run('netsh int tcp set global timestamps=enabled')")
EndIf
If time_stamp = "disabled"
WshShell\Invoke("Run('netsh int tcp set global timestamps=disabled')")
EndIf
WshShell\Release()
EndIf
EndProcedure
Code: Select all
netsh interface ip set address "Local Area Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1
Code: Select all
Usage: set address [name=]<string>
[[source=]dhcp|static]
[[address=]<IPv4 address>[/<integer>] [[mask=]<IPv4 mask>]
[[gateway=]<IPv4 address>|none [gwmetric=]<integer>]
[[type=]unicast|anycast]
[[subinterface=]<string>]
[[store=]active|persistent]
Code: Select all
regExObject\SetProperty("IgnoreCase = " + Str(bIgnoreCase) + " AS BOOLEAN")
Code: Select all
Procedure Stac_IP(connection_name.s, desired_IP.s, sub_net_mask.s, gw_router.s)
Define WshShell.COMateObject
WshShell = COMate_CreateObject("WScript.Shell")
If WshShell
WshShell\Invoke("Run('netsh interface ip set address $0027" + connection_name + "$0027 static $0027" + desired_IP + "$0027 $0027" + sub_net_mask + "$0027 $0027" + gw_router + "$0027')")
WshShell\Release()
EndIf
EndProcedure
Code: Select all
WshShell\Invoke("Run('netsh interface ip set address name= $0027" + connection_name + "$0027 source= $0027" + static_change$ + "$0027 addr= $0027" + desired_IP + "$0027 mask= $0027" + sub_net_mask + "$0027 gateway= $0027" + gw_router + "$0027')")
Code: Select all
RegisterActiveX(GetCurrentDirectory()+"AutoItX3.dll")
automation = COMate_CreateObject("AutoItX3.Control")
anf this is these intstruction wich cause a crash
Automation\SetPropertyRef("ControlSetText('Importation complète...','Regarder &dans','Edit1',"+"'" +strChemin +"')")
Description of ControlSetText
ControlSetText "title", "text", "controlID", "new text"
Parameters
title The title of the window to access.
text The text of the window to access.
controlID The control to interact with. See Controls.
new text The new text to be set into the control.
Return Value
Success: Returns 1.
Failure: Returns 0 if window/control is not found.
Hello! Just checking back in to see if this has come around yetsrod wrote: Right, I'm off to study 'Event sinks' now... Let's hope I have more luck than I generally do with kitchen sinks!