SHARE
TWEET

Untitled

a guest Jun 12th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $assemblies=(
  2.     "System"
  3. )
  4.  
  5. $source=@"
  6. using System;
  7. namespace Helloworld
  8. {
  9.     public static class Hello{
  10.         static void Main(string[] args)
  11.         {
  12.             RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
  13.             //deleting 'someKey'
  14.             key.DeleteSubKey("someKey");
  15.             key.Close();
  16.         }
  17.     }
  18. }
  19. "@
  20.  
  21. Add-Type -ReferencedAssemblies $assemblies -TypeDefinition $source -Language CSharp
  22. [HelloWorld.Hello]::Main()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top