title: NetworkService permission (multi-language)
body: <p>So, I'm doing a setup project, all written in VB.NET, and I need to give to the NetworkService account, permission on a certain folder.</p>
  
  <p>The following code works perfect (Windows 7 - en-US):</p>
  
  <pre><code>Dim dInfo As New DirectoryInfo("C:\FolderOrFileToGivePermission")
  Dim dSecurity As DirectorySecurity = dInfo.GetAccessControl()
  dSecurity.AddAccessRule(New FileSystemAccessRule("NETWORK SERVICE", FileSystemRights.FullControl, AccessControlType.Allow))
  dInfo.SetAccessControl(dSecurity)
  </code></pre>
  
  <p>The problem began when I try this very same code on my Windows 7, Vista or XP (<strong>all in PT-BR</strong>) , I found that there is no "NETWORK SERVICE", the correct name is "Serviço de Rede".</p>
  
  <p>I need to get this name to give permission to the right user.</p>
  
  <p>After a lot of investigation on all 3 OSes, I found that the ID for the user is: "S-1-5-20", his path on the registry is: Computer\HKEY_USERS\S-1-5-20
  and the default folder for it: C:\Windows\ServiceProfiles\NetworkService</p>
  
  <p>But I still didn't find the actual "localizable" name and I need it to be dynamic, because this system will be installed in a lot of different countries (different machines and cultures).</p>
  
  <p>Thanks in advance.</p>