i want to add new rule windows firewall , am using system() function for this in c
normally cmd command for that would be
netsh advfirewall firewall add rule name="myp" dir=in action=allow
program="C:\test\Project1.exe"
so i want to know how i can insert it to system(); function i try it but no success , i mean double quotes not works like
system("netsh advfirewall firewall add rule name="myp" dir=in action=allow program="C:\\test\\Project1.exe"");
You just need to escape the double quote –
\"to use it inside a string.See here for a list of other escape sequences.
Your command would then become