mm
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,68 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
namespace Runas
|
||||
{
|
||||
class Program
|
||||
{
|
||||
public static string DataText = RegexAllEnv(Runas.Properties.Resources.progs);
|
||||
public static dynamic jprograms = JsonConvert.DeserializeObject(DataText);
|
||||
public static string RegexAllEnv(string data)
|
||||
{
|
||||
System.Collections.Hashtable env = (System.Collections.Hashtable)Environment.GetEnvironmentVariables();
|
||||
string val;
|
||||
foreach (System.Collections.DictionaryEntry key in env)
|
||||
{
|
||||
val = (string)key.Value;
|
||||
val = val.Replace(@"\", @"\\");
|
||||
if (key.Key != "Path" && key.Key != "path")
|
||||
{
|
||||
data = val.EndsWith(@"\") ? Regex.Replace(data, $"\\u0025{key.Key}\\u0025\\\\", val, RegexOptions.IgnoreCase) : Regex.Replace(data, $"\\u0025{key.Key}\\u0025", val, RegexOptions.IgnoreCase);
|
||||
// val.EndsWith(@"\")? data.Replace($"%{key.Key}%\\", val) : data.Replace($"%{key.Key}%",val);
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
public static bool DoRun(string program)
|
||||
{
|
||||
Process[] process = Process.GetProcessesByName(program);
|
||||
return (process.Length > 0);
|
||||
}
|
||||
public static void RunProcess(string programName)
|
||||
{
|
||||
|
||||
if (!(DoRun(programName)))
|
||||
{
|
||||
if (programName.Equals("AutoHotKey"))
|
||||
{
|
||||
Process.Start(jprograms[programName][0].Value, $"\u0022{jprograms[programName][1].Value.ToString()}\u0022");
|
||||
}
|
||||
|
||||
else if (jprograms[programName].Count > 1)
|
||||
{
|
||||
foreach (var prog in jprograms[programName])
|
||||
{
|
||||
if (System.IO.File.Exists(prog.Value))
|
||||
{
|
||||
Process.Start(prog.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (jprograms[programName].Count == 1)
|
||||
{
|
||||
Process.Start(jprograms[programName][0].Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
static void Main(string[] args)
|
||||
{
|
||||
foreach (var prog in jprograms)
|
||||
{
|
||||
string ProgProg = ((Newtonsoft.Json.Linq.JProperty)prog).Name;
|
||||
System.Threading.Thread thread = new(new System.Threading.ThreadStart(() => RunProcess(ProgProg)));
|
||||
thread.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,85 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Runas.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Runas.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {
|
||||
/// "AutoHotKey": [
|
||||
/// "C:\\Program Files\\AutoHotkey\\AutoHotkey.exe",
|
||||
/// "D:\\Drive\\טוויקים למחשב\\myscript 3.0\\myscript 2.0.ahk"
|
||||
/// ],
|
||||
/// "Lightshot": [
|
||||
/// "C:\\Program Files (x86)\\Skillbrains\\lightshot\\Lightshot.exe"
|
||||
/// ],
|
||||
/// "AsusNbKeys": [
|
||||
/// "C:\\Program Files (x86)\\ASUS\\ATK Package\\AsusNbKeys\\AsusNbKeys.exe",
|
||||
/// "C:\\Program Files (x86)\\ASUS\\ATK Package\\ATK Hotkey\\AsusNbKeys.exe"
|
||||
/// ],
|
||||
/// "HControl": [
|
||||
/// "C:\\Program Files (x86)\\ASUS\ [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string progs {
|
||||
get {
|
||||
return ResourceManager.GetString("progs", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,41 +0,0 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v5.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v5.0": {
|
||||
"Runas/1.0.0": {
|
||||
"dependencies": {
|
||||
"Newtonsoft.Json": "13.0.1"
|
||||
},
|
||||
"runtime": {
|
||||
"Runas.dll": {}
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json/13.0.1": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Newtonsoft.Json.dll": {
|
||||
"assemblyVersion": "13.0.0.0",
|
||||
"fileVersion": "13.0.1.25517"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Runas/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Newtonsoft.Json/13.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==",
|
||||
"path": "newtonsoft.json/13.0.1",
|
||||
"hashPath": "newtonsoft.json.13.0.1.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"additionalProbingPaths": [
|
||||
"C:\\Users\\Saret\\.dotnet\\store\\|arch|\\|tfm|",
|
||||
"C:\\Users\\Saret\\.nuget\\packages"
|
||||
]
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net5.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,229 +0,0 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v6.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v6.0": {
|
||||
"Runas/1.0.0": {
|
||||
"dependencies": {
|
||||
"Newtonsoft.Json": "13.0.2",
|
||||
"Serilog": "2.12.0",
|
||||
"Serilog.Enrichers.Environment": "2.2.0",
|
||||
"Serilog.Enrichers.Thread": "3.1.0",
|
||||
"Serilog.Extensions.Logging": "3.1.0",
|
||||
"Serilog.Sinks.File": "5.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"Runas.dll": {}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions/2.0.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.0.0.17205"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging/2.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.0.0",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "2.0.0",
|
||||
"Microsoft.Extensions.Options": "2.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.Extensions.Logging.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.0.0.17205"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions/2.0.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.0.0.17205"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Options/2.0.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "2.0.0",
|
||||
"Microsoft.Extensions.Primitives": "2.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.Extensions.Options.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.0.0.17205"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/2.0.0": {
|
||||
"dependencies": {
|
||||
"System.Runtime.CompilerServices.Unsafe": "4.4.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Microsoft.Extensions.Primitives.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.0.0.17205"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Newtonsoft.Json/13.0.2": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Newtonsoft.Json.dll": {
|
||||
"assemblyVersion": "13.0.0.0",
|
||||
"fileVersion": "13.0.2.27524"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Serilog/2.12.0": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Serilog.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.12.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Serilog.Enrichers.Environment/2.2.0": {
|
||||
"dependencies": {
|
||||
"Serilog": "2.12.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Serilog.Enrichers.Environment.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "2.2.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Serilog.Enrichers.Thread/3.1.0": {
|
||||
"dependencies": {
|
||||
"Serilog": "2.12.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Serilog.Enrichers.Thread.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "3.1.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Serilog.Extensions.Logging/3.1.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Logging": "2.0.0",
|
||||
"Serilog": "2.12.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Serilog.Extensions.Logging.dll": {
|
||||
"assemblyVersion": "2.0.0.0",
|
||||
"fileVersion": "3.1.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Serilog.Sinks.File/5.0.0": {
|
||||
"dependencies": {
|
||||
"Serilog": "2.12.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net5.0/Serilog.Sinks.File.dll": {
|
||||
"assemblyVersion": "5.0.0.0",
|
||||
"fileVersion": "5.0.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/4.4.0": {}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"Runas/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions/2.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-eUdJ0Q/GfVyUJc0Jal5L1QZLceL78pvEM9wEKcHeI24KorqMDoVX+gWsMGLulQMfOwsUaPtkpQM2pFERTzSfSg==",
|
||||
"path": "microsoft.extensions.dependencyinjection.abstractions/2.0.0",
|
||||
"hashPath": "microsoft.extensions.dependencyinjection.abstractions.2.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Logging/2.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-VP10syWV/vxYYMKgZ2eDESmUsz3gPxvBn5J6tkVN8lI4M+dF43RN8fWsEPbcAneDmZrHl3Pv23z05nmyGkJlpg==",
|
||||
"path": "microsoft.extensions.logging/2.0.0",
|
||||
"hashPath": "microsoft.extensions.logging.2.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions/2.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-6ZCllUYGFukkymSTx3Yr0G/ajRxoNJp7/FqSxSB4fGISST54ifBhgu4Nc0ItGi3i6DqwuNd8SUyObmiC++AO2Q==",
|
||||
"path": "microsoft.extensions.logging.abstractions/2.0.0",
|
||||
"hashPath": "microsoft.extensions.logging.abstractions.2.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Options/2.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-sAKBgjl2gWsECBLLR9K54T7/uZaP2n9GhMYHay/oOLfvpvX0+iNAlQ2NJgVE352C9Fs5CDV3VbNTK8T2aNKQFA==",
|
||||
"path": "microsoft.extensions.options/2.0.0",
|
||||
"hashPath": "microsoft.extensions.options.2.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Primitives/2.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-ukg53qNlqTrK38WA30b5qhw0GD7y3jdI9PHHASjdKyTcBHTevFM2o23tyk3pWCgAV27Bbkm+CPQ2zUe1ZOuYSA==",
|
||||
"path": "microsoft.extensions.primitives/2.0.0",
|
||||
"hashPath": "microsoft.extensions.primitives.2.0.0.nupkg.sha512"
|
||||
},
|
||||
"Newtonsoft.Json/13.0.2": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-R2pZ3B0UjeyHShm9vG+Tu0EBb2lC8b0dFzV9gVn50ofHXh9Smjk6kTn7A/FdAsC8B5cKib1OnGYOXxRBz5XQDg==",
|
||||
"path": "newtonsoft.json/13.0.2",
|
||||
"hashPath": "newtonsoft.json.13.0.2.nupkg.sha512"
|
||||
},
|
||||
"Serilog/2.12.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-xaiJLIdu6rYMKfQMYUZgTy8YK7SMZjB4Yk50C/u//Z4OsvxkUfSPJy4nknfvwAC34yr13q7kcyh4grbwhSxyZg==",
|
||||
"path": "serilog/2.12.0",
|
||||
"hashPath": "serilog.2.12.0.nupkg.sha512"
|
||||
},
|
||||
"Serilog.Enrichers.Environment/2.2.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-DMrj3A4l65kc4JouQyZjjFv7N58Y7lGsB81kSzorTwUGeI2wrTy7CVwSOfG90/Pcu/HV5bwGrUmxDZ38pON+5Q==",
|
||||
"path": "serilog.enrichers.environment/2.2.0",
|
||||
"hashPath": "serilog.enrichers.environment.2.2.0.nupkg.sha512"
|
||||
},
|
||||
"Serilog.Enrichers.Thread/3.1.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-85lWsGRJpRxvKT6j/H67no55SUBsBIvp556TKuBTGhjtoPeq+L7j/sDWbgAtvT0p7u7/phJyX6j35PQ4Vtqw0g==",
|
||||
"path": "serilog.enrichers.thread/3.1.0",
|
||||
"hashPath": "serilog.enrichers.thread.3.1.0.nupkg.sha512"
|
||||
},
|
||||
"Serilog.Extensions.Logging/3.1.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-IWfem7wfrFbB3iw1OikqPFNPEzfayvDuN4WP7Ue1AVFskalMByeWk3QbtUXQR34SBkv1EbZ3AySHda/ErDgpcg==",
|
||||
"path": "serilog.extensions.logging/3.1.0",
|
||||
"hashPath": "serilog.extensions.logging.3.1.0.nupkg.sha512"
|
||||
},
|
||||
"Serilog.Sinks.File/5.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-uwV5hdhWPwUH1szhO8PJpFiahqXmzPzJT/sOijH/kFgUx+cyoDTMM8MHD0adw9+Iem6itoibbUXHYslzXsLEAg==",
|
||||
"path": "serilog.sinks.file/5.0.0",
|
||||
"hashPath": "serilog.sinks.file.5.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Runtime.CompilerServices.Unsafe/4.4.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-9dLLuBxr5GNmOfl2jSMcsHuteEg32BEfUotmmUkmZjpR3RpVHE8YQwt0ow3p6prwA1ME8WqDVZqrr8z6H8G+Kw==",
|
||||
"path": "system.runtime.compilerservices.unsafe/4.4.0",
|
||||
"hashPath": "system.runtime.compilerservices.unsafe.4.4.0.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net6.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "6.0.0"
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user