Using Windows Firewall Rules in your Regional Language

garlin

Moderator
Staff member
There are several online guides, which help explain how to enable Windows Firewall rules to allow Network Discovery (file sharing), or Remote Desktop access.

You might see commands like:
Code:
netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes
powershell Enable-NetFirewallRule -DisplayGroup 'Remote Desktop'

Unfortunately, the group names ("Network Discovery") are very different if your regional language isn't English. Instead you can substitute a static rule value, or use PowerShell to search for the translated group name.
Code:
Network Discovery:
netsh advfirewall firewall set rule group="@FirewallAPI.dll,-32752" new enable=Yes

Remote Desktop:
netsh advfirewall firewall set rule group="@FirewallAPI.dll,-28752" new enable=Yes

en-US:
Code:
Get-NetFirewallRule | where { $_.Group -match '-32752|-28752' } | select -Unique DisplayGroup,Group

DisplayGroup      Group               
------------      -----               
Network Discovery @FirewallAPI.dll,-32752
Remote Desktop    @FirewallAPI.dll,-28752

fr-FR:
Code:
Get-NetFirewallRule | where { $_.Group -match '-32752|-28752' } | select -Unique DisplayGroup,Group

DisplayGroup        Group               
------------        -----               
Recherche du réseau @FirewallAPI.dll,-32752
Bureau à distance   @FirewallAPI.dll,-28752
Code:
netsh advfirewall firewall set rule group="Recherche du réseau" new enable=Yes
powershell Enable-NetFirewallRule -DisplayGroup 'Bureau à distance'
 
takeown is another command affected by your regional language. /d y or "Yes to confirm" is English-specific. This command option fails in most other regions because a positive answer is a different word, like:

/d oui (French)
/d ja (German)
/d si (Spanish)

To understand what's should be the correct first letter, run the choice command.
Code:
choice <NUL 2>NUL
[Y,N]?

Batch command:
Code:
for /f "tokens=1,2 delims=[,]" %%a in ('"choice <nul 2>nul"') do set "yes=%%a"
takeown /r /d %yes% /f random_file
PowerShell:
Code:
$Yes = (Out-Null | choice 2> Out-Null).Substring(1,1)
takeown /r /d $Yes /f random_file
 
Back
Top