2014-06-26, 19:51
(2014-06-26, 03:36)Angelscry Wrote: Why not create a files launcher where the executable file will be your script and the items would be your .ini files?
Application : Netflix_script.exe
Argument : "%rom%"
File extension : .ini
Then your script would be modified to receive the path of the config.ini file as argument :
Code:#RequireAdmin
#include <Process.au3>
HotKeySet("{ESC}", "KillTask")
Opt("WinTitleMatchMode", 2)
If $CmdLine[0] == 1 Then
$networkAdapter = IniRead($CmdLine[1], "NetworkAdapter", "Active", "0")
$primaryLocalDNS = IniRead($CmdLine[1], "LocalDNS", "Primary", "0")
$secondaryLocalDNS = IniRead($CmdLine[1], "LocalDNS", "Secondary", "0")
$primaryForeignDNS = IniRead($CmdLine[1], "ForeignDNS", "Primary", "0")
$secondaryForeignDNS = IniRead($CmdLine[1], "ForeignDNS", "Secondary", "0")
RunWait(@ComSpec & " /c netsh interface ip set dns " & $networkAdapter & " static " & $primaryForeignDNS & "", "", @SW_HIDE)
RunWait(@ComSpec & " /c netsh interface ip add dns " & $networkAdapter & " addr= " & $secondaryForeignDNS & " index=2", "", @SW_HIDE)
;RunWait(@ComSpec & " /c ipconfig /flushdns", "", @SW_HIDE)
EndIf
ShellExecute("Netflix.lnk")
While 1
Sleep(100)
WEnd
Func KillTask()
Send ( "!{F4}")
RunWait(@ComSpec & " /c netsh interface ip set dns " & $networkAdapter & " static " & $primaryLocalDNS & "", "", @SW_HIDE)
RunWait(@ComSpec & " /c netsh interface ip add dns " & $networkAdapter & " addr= " & $secondaryLocalDNS & " index=2", "", @SW_HIDE)
;RunWait(@ComSpec & " /c ipconfig /flushdns", "", @SW_HIDE)
WinActivate("XBMC")
Exit 0
EndFunc
Then finaly create different .ini files for each country (canadian.ini, american.ini, etc...) and put them into the same directory. It will do the job, no?
Ohhh I hadn't thought of that, yeah that actually works perfectly! Thanks!!