Reputation: 901
On Windows, system32\fsquirt.exe
launches the Bluetooth file transfer dialog.
Is there a way to launch fsquirt.exe with a path as an argument, so that it behaves like "Send to -> Bluetooth Device"
in Windows Explorer?
Upvotes: 1
Views: 2051
Reputation: 147
I replaced fsquirt
with a program that prints its arguments, and found out that when you click "Send to > Bluetooth device", Explorer invokes
fsquirt.exe -Embedding
This parameter indicates that the application is being launched as "local COM server application", which is "embedded" into another application (Explorer). The list of files to be sent over Bluetooth is then communicated to fsquirt
via this local COM server. It's pretty much infeasible to figure out how to do this without having access to the source code. More info here: https://learn.microsoft.com/en-us/windows/win32/com/localserver32
FWIW, when you run it with -Embedding
from command line, it returns immediately and spawns a sub-process (also with the -Embedding
flag, as can be seen in Task Manager) which exits after 10 seconds. My guess is that this sub-process waits for commands to be received via the local COM server, and if no command is received within 10 seconds, it exits.
If you want to send files via Bluetooth programmatically, wihtout any user interface, there's a set of tools designed precisely for this: https://bluetoothinstaller.com/bluetooth-command-line-tools
I haven't tested it but it seems pretty full-featured, and is available for free.
It can send one or more files either to a paired device using its name, or to arbitrary device using its Bluetooth MAC address. From the documentation:
- Send file "picture.jpg" from the current folder to the device named "Nokia 6300":
btobex -n"Nokia 6300" picture.jpg
- Send all text files from the current folder to the device with known address:
btobex -b(11:11:22:22:33:33) *.txt
- Send output of other program as a file named "message.txt":
echo This is a test | btobex -b(11:11:22:22:33:33) -f"message.txt"
Upvotes: 1
Reputation: 21
It is probably not exactly what you are looking for, but a little closer to it
fsquirt.exe -send
fsquirt.exe -receive
Upvotes: 2
Reputation: 2021
As usual the MS documentation about their tools is sparse. I only found two parameters one could pass but none does what you need. They have no help in the command line for fsquirt so I pressume there are no more parameters to pass the initial dialog.
If you really need this I'd suggest a third-party tool to bypass the first dialog.
From personal experience I can recommend DisplayFusion
. Within DF you can set rules, whenever a Window with certan criteria (like Window-Title, Window-Class, ..) opens up, to start custom actions. You can set predefined actions or even write your own in C#.
I had a similar case and wrote a small C# script that simulates a keypress whenever a specific window opened. It's quite easy and not as deep as AutoHotkey for example. But it's quite a lot things to do regarding the quest.
Send to -> Bluetooth Device
can be 'clicked' by pressing ALT + S
Upvotes: 0