如何从命令行在法语 Windows 系统上激活文件和打印机共享?

How to activate File and printer sharing on a French Windows system from commande line?

我正在尝试从命令行启用文件和打印机共享,经过一些谷歌搜索后我发现正确的命令可以实现这一点:

netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=yes

如果 Windows 语言是英语,这似乎没问题。但是,在我的法语 Windows 中,这是管理命令提示符的结果:

Aucune règle ne correspond aux critères spécifiés.

我也试过这个命令行:

netsh advfirewall firewall set rule group="Partage de fichiers et d'imprimantes" new enable=yes

但效果不佳,我也得到了相同的结果:

Aucune règle ne correspond aux critères spécifiés.

我没有 windows 的法语版本,所以很遗憾不能直接告诉你,但有两种方法可以找到它:

  1. 搜索有关打印的所有规则(imprimante 将是我的第一个建议)。然后select组名。

    netsh advfirewall firewall show rule name=all | findstr imprimante

  2. 打开高级防火墙ui,找到下图中突出显示的 equivalent 字符串,然后将其输入命令行。