title: PSExec registry file remotly
body: <p>I am trying to execute a PowerShell to execute a reg file remotly</p>
  
  <p>This is what I have at the moment:</p>
  
  <pre><code>$computer = 'IP';
  $username = 'user';
  $password = 'password';
  $reg      = 'regedit /s //ip/teste.reg';
  
  $reg_command = "psExec -i -d -c -f -s \\$computer -u $computer\$username -p $password `"$reg`"";
  
  Write-Output "Inserting regestry file...";
  
  Invoke-Expression $reg_command; 
  </code></pre>
  
  <p>I have psExec in my computer, but I don't know how I would add the path executable for PSExec in the code.</p>