-1
I need a python preject to change the port in the windows registry (HKEY_LOCAL_MACHINE System Currentcontrolset002 Control Terminal Server Winstations RDP-Tcp Portnumber) and (HKEY_LOCAL_MACHINE System Currentcontrolset001 Control Terminal Server Winstations RDP-Tcp Portnumber) and create an input and output rule for that same port in the Firewall giving permissions on the port, By not assembling the code. Could someone tell me the correct way to assemble this code? The code below is what I started with the firewall rule.However it is not creating the rule, I did several tests this was the last code I used:
import the import re import winreg
port = int(input('Enter port: ')) quotation marks = ("'")
portastr = str(port) portahera = '%x' % port release = ('netsh advfirewall firewall add Rule name="port ts server" dir=in action=allow Protocol=TCP localport=') tcp = (quotes+release+port+quotes) os.system(tcp) print(tcp)