
File and Printer Sharing
PsExec을 사용하여 네트워크에 있는 Windows 7 컴퓨터의 cmd에 액세스하고 있으며, 일어나서 컴퓨터까지 걸어갈 필요 없이 Windows 방화벽을 켜고 싶습니다 .
이 작업을 수행하려면 어떤 명령을 사용해야 합니까?
감사해요
답변1
이 명령은 파일 및 프린터 공유를 관리해야 합니다.
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
방화벽의 경우:
netsh advfirewall set currentprofile state on
나는 지금 그것들을 시도해 보았고 그것은 나에게 효과가 있는 것 같습니다.
추가 정보는 Microsoft의 KB 문서를 참조하세요.http://support.microsoft.com/kb/947709
답변2
개인 프로필에 대해서만 파일 및 프린터 공유를 켜려면 다음 명령을 사용할 수 있습니다.
netsh firewall set service type=fileandprint mode=enable profile=standard
Windows 8 또는 Windows Server 2012 이상 OS의 경우 다른 명령을 사용할 수 있습니다.
wmic /namespace:\\Root\StandardCimv2 path MSFT_NetFirewallRule where (RuleGroup="@FirewallAPI.dll,-28502" and Profiles=2) call enable
답변3
net start
명령을 사용하여 서비스를 시작할 수 있습니다 . 예를 들어:
net start "Windows Firewall"
하지만 제한된 조사에 따르면 파일 및 프린터 공유는 CLI에서 이름으로 호출할 수 있는 서비스가 아닙니다. 그러나 Windows 방화벽은 그렇습니다.
답변4
netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in new enable=Yes