Hi Jackson1990-7147,
Based on your code, you need to change "action=block" to "action=allow".
Then you need to pass an argument to cmd.exe via following code:
System.Diagnostics.ProcessStartInfo proc = new System.Diagnostics.ProcessStartInfo();
proc.FileName = "CMD.exe";
proc.Arguments ="/k "+f1d1;
System.Diagnostics.Process.Start(proc);
For more information about how to add firewall rules, run the following command:
netsh advfirewall firewall add rule ?
And here is a useful document you can refer to.
Best Regards,
Daniel Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.