Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $assemblies=(
- "System",
- "Microsoft.Win32"
- )
- $source=@"
- using System;
- using Microsoft.Win32;
- namespace Helloworld
- {
- public static class Hello{
- static void Main(string[] args)
- {
- RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
- //deleting 'someKey'
- key.DeleteSubKey("someKey");
- key.Close();
- }
- }
- }
- "@
- Add-Type -ReferencedAssemblies $assemblies -TypeDefinition $source -Language CSharp
- [HelloWorld.Hello]::Main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement