Hallo zusammen,
ich habe eine Frage die für euch wahrscheinlich ein leichtes ist, ich aber nicht verstehe wieso:
Problem Beschreibung:
Ich habe eine Anwendung - normale WinForm mit einem Hyperlink. Über diesen Hyperlink sollen Benutzer ihren BitLocker Pin ändern können.
Ich dachte es wäre super simpel, es eben mit einzubauen doch leider funktioniert es einfach nicht. Den Bitlocker Pin ändert man über die exe bdechangepin in system32. Mein Code scheint auch korrekt zu sein und ich kann auch beliebige andere EXEN starten nur diese nicht.
Mein Code dazu sieht wie folgt aus:
C#-Quelltext
1: 2: 3:
| string Path = Environment.SystemDirectory + "\\bdechangepin.exe"; Process.Start(Path); |
Die Message Box, gibt auch den korrekt Pfad wie gewünscht aus. Kopiert man diesen manuell in CMD geht auch die GUI zum ändern des PINs auf.
Fehlermeldung in Visual Studio: System.ComponentModel.Win32Exception: 'The system cannot find the file specified'
Eventuell liegt es daran, dass die App nicht als Admin gestartet wird. Darum habe ich auch folgendes Probiert mit dem selben Ergebnis von oben:
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
| string pathsoft = "C:\\Windows\\System32\\bdechangepin.exe"; if (File.Exists(pathsoft)) {
Process proc = new Process(); proc.StartInfo.FileName = pathsoft; proc.StartInfo.UseShellExecute = true; proc.StartInfo.Verb = "runas"; proc.Start();
} else {}
} |
Jemand eine Idee ?
Vielen Dank im Voraus