SHARE
TWEET

Untitled

a guest Jun 12th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $assemblies=(
  2.     "System",
  3.     "Microsoft.Win32"
  4. )
  5.  
  6. $source=@"
  7. using System;
  8. using Microsoft.Win32;
  9. namespace Helloworld
  10. {
  11.     public static class Hello{
  12.         static void Main(string[] args)
  13.         {
  14.             RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
  15.             //deleting 'someKey'
  16.             key.DeleteSubKey("someKey");
  17.             key.Close();
  18.         }
  19.     }
  20. }
  21. "@
  22. Add-Type -ReferencedAssemblies $assemblies -TypeDefinition $source -Language CSharp
  23.  
  24. [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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top