Locating "Add Bluetooth Device" 's exe location
I was keen 开发者_Go百科on using the Process class [C#] to open "Add Bluetooth Device" wizard, but I was wondering what is the location of the wizard's exe?
I would be glad if someone can help.
Thanks
On Windows 7, it's C:\Windows\system32\DevicePairingWizard.exe
. Process Explorer says it was openeed with the following command line:
"C:\Windows\System32\DevicePairingWizard.exe" Provider\Microsoft.Devices.Bluetooth
The first thing you need to do to execute any type of .exe from your code is to find the location of the .exe. This can be done it two way:
- You could run the .exe and while it is running open the Task Manager and go to the process that is affiliated with that .exe. The location of this .exe will be shown in the general tab of the properties of this process.
- Or, if that fails, you could simply Google it. For example, I searched 'add network device shortcut' and easily found the location of the .exe that you wanted. How to Create a "Add a Device" Shortcut
All you need to do after that, is put a 'Process.Start()' method.
(MSDN Definition - Starts a process resource by specifying the name of a document or application file and associates the resource with a new Process component.)
private void buttonClick() {
{
Process.Start("C:\\Windows\\System32\\DevicePairingWizard.exe");
}
}
I know this answer is a bit late but I hope it helps anyone else that comes across this question looking for the same answer.
精彩评论