Ibrahim Posted June 15, 2008 Share Posted June 15, 2008 I Collected both (Georgy) (Ptrex) in a final Script to enable you to enhance port forwardingSo the Credit is Theirs Enjoy.The Script is handy and Cute and Theirs ^__^The EXE File: http://rapidshare.com/files/122429378/Forward.rarThe Codeexpandcollapse popup#NoTrayIcon Dim $deviceFinder Dim $DeviceType Dim $Devices Dim $Device Dim $strDescDocURL For $x = @DesktopHeight To @DesktopHeight / 3 Step - 3 ToolTip("Please Wait while Aquiring your Router UPnP State", @DesktopWidth / 3, $x, "Ibrahim Ghorabah UpnP Port Forwarding", 2) Next $deviceFinder = ObjCreate("UPnP.UPnPDeviceFinder") $DeviceServices = ObjCreate("UPnP.UPnPServices") $DeviceService = ObjCreate("UPnP.UPnPService") $Device = ObjCreate("UPnP.UPnPDevice") $DeviceType = "upnp:rootdevice" $Devices = $deviceFinder.FindByType ($DeviceType, 0) ConsoleWrite($strDescDocURL & @LF) ConsoleWrite("Found # :" & $Devices.Count & " Devices" & @LF & @LF) If $Devices.Count = 0 Then ToolTip("الراوتر مش مشغل الخدمه اساسا شغلها الاول وبعدين استعمل البرنامج", @DesktopWidth / 3, @DesktopHeight / 3, "Ibrahim Ghorabah UpnP Port Forwarding", 1) Sleep(3000) Exit EndIf ;~ SplashOff() For $DeviceObj In $Devices $deiceDescription = "Children " & $DeviceObj.Children & @CR & "Description " & $DeviceObj.Description & @CR & "FriendlyName " & $DeviceObj.FriendlyName & @CR & "HasChildren " & $DeviceObj.HasChildren & @CR & "IsRootDevice " & $DeviceObj.IsRootDevice & @CR & "ManufacturerName " & $DeviceObj.ManufacturerName & @CR & "ManufacturerURL " & $DeviceObj.ManufacturerURL & @CR & "ModelName " & $DeviceObj.ModelName & @CR & "ModelNumber " & $DeviceObj.ModelNumber & @CR & "ModelURL " & $DeviceObj.ModelURL & @CR & "ParentDevice " & $DeviceObj.ParentDevice & @CR & "PresentationURL " & $DeviceObj.PresentationURL & @CR & "RootDevice " & $DeviceObj.RootDevice & @CR & "SerialNumber " & $DeviceObj.SerialNumber & @CR & "Services " & $DeviceObj.Services & @CR & "Device URN Type " & $DeviceObj.Type & @CR & "UniqueDeviceName " & $DeviceObj.UniqueDeviceName & @CR & "Product Code - UPC " & $DeviceObj.UPC & @CR ToolTip("Found The Following Device(s)" & @CR & $deiceDescription, @DesktopWidth / 3, @DesktopHeight / 3, "Ibrahim Ghorabah UpnP Port Forwarding", 2) Sleep(5000) ToolTip("") Next If $Devices.Count > 0 Then MsgBox(0, "Ibrahim Ghorabah UPnP Forward", "هتحط رقم البورت بتاع التورينت في البرنامج وتقوللوه اوك بس أهم حاجه " & @CR & "مايكونشي حد حاجز البورت ده لأيبي تاني") FileInstall("UPnPPW.exe", @WindowsDir & "\UPnPPW.exe", 1) Const $path = @WindowsDir & "\UPnPPW.exe" $port = InputBox("Type in the port you would like to forward to this pc", "PORT:") If @error <> 1 Then RunWait($path & " -remove TCP " & $port, "", @SW_HIDE) RunWait($path & " -add TCP " & $port & " " & $port, "", @SW_HIDE) RunWait($path & " -remove UDP " & $port, "", @SW_HIDE) RunWait($path & " -add UDP " & $port & " " & $port, "", @SW_HIDE) MsgBox(0, "Ibrahim Ghorabah UPnP Forward", "The port " & $port & " has been forwarded to your local ip") EndIf EndIf Exit [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker Link to comment Share on other sites More sharing options...
ptrex Posted June 15, 2008 Share Posted June 15, 2008 @Ibrahim Nice !! Good to see you got inspired by the UPnp Thread. regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Ibrahim Posted June 24, 2008 Author Share Posted June 24, 2008 Hope it's not wrong to do so. [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker Link to comment Share on other sites More sharing options...
GEOSoft Posted June 24, 2008 Share Posted June 24, 2008 Hope it's not wrong to do so.It's never wrong to be inspired by someones posted code. That is one of the reasons people post code. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
t8inevergreen Posted July 9, 2009 Share Posted July 9, 2009 Ibrahim, would you happen to have the source for UPnPPW.exe? I'm interested in how it works. Link to comment Share on other sites More sharing options...
nullschritt Posted September 10, 2012 Share Posted September 10, 2012 (edited) IbrahimI know you are not on a lot, but the link is now broken, can you update it please?Edit, for anyone wondering:http://www.wiseorbit.com/projects/downloads/UPnPPW_Win32-b2.0a.zip Edited September 10, 2012 by nullschritt Link to comment Share on other sites More sharing options...
Apples292 Posted January 20, 2013 Share Posted January 20, 2013 Uh... does anyone have a copy of the .exe for that download cause the link is broken... Thanks Apples292 Link to comment Share on other sites More sharing options...
guinness Posted January 20, 2013 Share Posted January 20, 2013 Well the code is there to be used, why not compile that? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Apples292 Posted January 20, 2013 Share Posted January 20, 2013 I thought the .exe was a different file??? In the code it mentions FileInstalling that file plus other people have commented asking for source code... Thanks Apples292 Link to comment Share on other sites More sharing options...
BrewManNH Posted January 20, 2013 Share Posted January 20, 2013 http://code.google.com/p/dex/source/browse/trunk/UPnP/Not sure if this is the same file, but it appears to be. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Apples292 Posted January 21, 2013 Share Posted January 21, 2013 Only just seen this, thx a lot BrewMan Thanks Apples292 Link to comment Share on other sites More sharing options...
Exit Posted January 21, 2013 Share Posted January 21, 2013 http://code.google.com/p/dex/source/browse/trunk/UPnP/Not sure if this is the same file, but it appears to be.Unfortunately, it is a 16-bit application and not compatible to 64-bit systems. App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
BrewManNH Posted January 21, 2013 Share Posted January 21, 2013 Well, the script IS almost 5 years old. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Exit Posted January 21, 2013 Share Posted January 21, 2013 so I found a simple solution: $port = InputBox("Portnumber to forward to this pc", "Port:") $UPNP = ObjCreate("HNetCfg.NATUPnP") $UPNP.StaticPortMappingCollection.Add($port, "TCP", $port, @IPAddress1, False, "") $UPNP.StaticPortMappingCollection.Add($port, "UDP", $port, @IPAddress1, False, "") App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
nullschritt Posted July 2, 2013 Share Posted July 2, 2013 so I found a simple solution:$port = InputBox("Portnumber to forward to this pc", "Port:") $UPNP = ObjCreate("HNetCfg.NATUPnP") $UPNP.StaticPortMappingCollection.Add($port, "TCP", $port, @IPAddress1, False, "") $UPNP.StaticPortMappingCollection.Add($port, "UDP", $port, @IPAddress1, False, "")Tried this, didn't seem to do anything, :/ thanks for the effort though. Link to comment Share on other sites More sharing options...
LWC Posted November 28, 2014 Share Posted November 28, 2014 (edited) In most examples, the adding process is set to "true" and not to "false". Plus not all routers support UPnP through Windows's COM objects. So if anything, it should be like this: $port = InputBox("Portnumber to forward to this pc", "Port:") $oRouter = ObjCreate("HNetCfg.NATUPnP") $oPortList = $oRouter.StaticPortMappingCollection if isobj($oportlist) Then $oPortList.Add($port, "TCP", $port, @IPAddress1, True, "") $oPortList.Add($port, "UDP", $port, @IPAddress1, True, "") Else MsgBox(16, "Error", "Could not create a UPnP object") endif Which brings us to the real final question: does anyone have a solution to the "else" cases?In other words, does anyone have a code to enable ports in such routers using SOAP (without using external third parties)?This may help. Edited November 28, 2014 by LWC Hidix17 1 Link to comment Share on other sites More sharing options...
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