Advertisement
Guest User

Untitled

a guest
Jun 12th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement