Skip to content

Commit 019bffb

Browse files
committed
Use cmd.exe in the system folder to make sure no hijacking
Thanks u/scrthq for suggestiong this!
1 parent ded77d1 commit 019bffb

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

OpenVRStartup/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ private static void RunScripts()
117117
foreach (var file in files)
118118
{
119119
LogUtils.WriteLineToCache($"Executing: {file}");
120+
var path = Path.Combine(Environment.CurrentDirectory, file);
120121
Process p = new Process();
121122
p.StartInfo.CreateNoWindow = true;
122123
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
123-
p.StartInfo.FileName = Path.Combine(Environment.CurrentDirectory, file);
124+
p.StartInfo.FileName = Path.Combine(Environment.SystemDirectory, "cmd.exe");
125+
p.StartInfo.Arguments = $"/C \"{path}\"";
124126
p.Start();
125127
}
126128
if(files.Length == 0) LogUtils.WriteLineToCache("Did not find any .cmd files to execute.");

OpenVRStartup/Properties/Resources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OpenVRStartup/Properties/Resources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120120
<data name="Version" xml:space="preserve">
121-
<value>v0.0.3</value>
121+
<value>v0.0.5</value>
122122
</data>
123123
</root>

0 commit comments

Comments
 (0)