VirusTotal scan result: https://www.virustotal.com/gui/file/90f4c675e360b0933819d63fee7d93f097013ed8867520f8bfb4c553b867dbcd/detection
Last active
May 4, 2020 03:38
-
-
Save runo280/81e40f8a647d37c0bff1b7fafa713d97 to your computer and use it in GitHub Desktop.
Telegram Instance Runner [for Windows]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.IO; | |
namespace Telegram | |
{ | |
internal class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
try | |
{ | |
var path = Process.GetCurrentProcess().MainModule?.FileName; | |
Console.WriteLine($"path: {path}"); | |
var dir = Path.GetDirectoryName(path); | |
Console.WriteLine($"dir: {dir}"); | |
var name = Path.GetFileNameWithoutExtension(path); | |
if ("Telegram".Equals(name, StringComparison.OrdinalIgnoreCase)) return; | |
Console.WriteLine($"name: {name}"); | |
var finalPath = $"{dir}\\t{name}"; | |
Console.WriteLine($"finalPath: {finalPath}"); | |
if (Directory.Exists(finalPath)) Directory.CreateDirectory(finalPath); | |
ProcessStartInfo tg = new ProcessStartInfo | |
{ | |
FileName = $@"{dir}\\Telegram.exe", | |
Arguments = $@"-many -workdir {finalPath}" | |
}; | |
Process.Start(tg); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine($"{e.Message}"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment