Rclone mount - progrmatic umount under windows

and as @ncw has mentioned above.
"As far as I remember the only way to unmount a drive on Windows with rclone is to kill the rclone process."

so if that is true, then hardkill is the only way.

the solution would be for winfsp to have an easy way to unmount but i have been looking at the website and i cannot find the way so far.

also, @kapitainsky is using QT framework for webbrowsers on windows.
seems that no matter what, a hardkill will be needed.

I have suggested this enhancement in rclone github repo #3575

1 Like

I have been unmounting already several months using the SendSignal executable and killing the mount window. No sign of lateral damages by now.
On the other hand, have you had a look to my reference this one

It is providing a way to unmount WinFSP, perhaps a way to go?

They claim:
The proper way to unmount a file system that uses WinFsp-FUSE is by sending it a Ctrl-C. On Windows this is done by calling GenerateConsoleCtrlEvent

And, by the way, thanks for making RcloneBrowser alive again!
A lot of progress since your first release!

yes, i am aware of that info,
the problem is that it is not safe to close the mount via winfsp, as rclone might be using caching and other features and could lead to data corruption.

please the my post

and about sendsignal.exe i have never got it to work once.
perhaps i am using an old version.
please, can you post a link to where you got your version?


You are right about caching...

SendSignal... I have no more info that what I wrote:

On sending Control-C, I found also several executables that do it. A search for SendSignal and SendControl brings some of them.

I found very interesting


I will try with
32bits https://www.dropbox.com/s/r96jxglhkm4sjz2/SendSignalCtrlC.exe?dl=0
Clean as today by Virustotal https://www.virustotal.com/#/file/bdd0a7c3f14d1105a81cbb32d75762dd948da10bb227bf27c9c4ff09654ee8a3/detection
(this is for info for those interested; note that your safety is your call do not blame me…)

64bits https://www.dropbox.com/s/hhe0io7mcgcle1c/SendSignalCtrlC64.exe?dl=0
Clean also by Virrustotal today

I will upload the bats I am using so you can try with them.

In the first link I remember seeing links to the source code of SendSignal, but I have not checked if they work.


interesting, i had found a .exe named SendSignal.exe and that never worked for me.
i will try your links.

and yes, i already read that web.archive.org link but thanks for that anyway.


Currently I just use Taskill

Bat to mount

SET mountLetter=H
SET myconfig=C:\ConfigFolder\rclone-conf-POINTER.txt
SET rcloneexe=C:\RCloneFolder\rclone.exe
chcp 65001>Nul


%_rcloneexe% --user-agent yourAgent --config %_myconfigb% --vfs-cache-mode full mount REMOTENAME:FOLDERNAME %MountLetter%:



SET MountLetter=H
SET WindowName=MOUNTED_%MountLetter%

for /f "tokens=2 USEBACKQ" %%f IN (tasklist /NH /FI "WINDOWTITLE eq %WindowName%*") Do TASKKILL /PID %%f


real nice code there,

sure, we all agree that taskkill will work with rclone.exe if there is a window to kill.
and i think @thestigma has shared some code similar to yours, using TITLE

but what if there is no window, then what?

SendSignal of course

the issue is that the developer of rclonebrowser, is having issues killing rclone.exe on windows.

in any event, sendsignal.exe and the SendSignalCtrlC64.exe as suggested by you do not work for me at all. i have tried many times, many different ways.
believe me, i want them to work, really i do.

i tend to run paranoid and i ran those sendsignal.exe, SendSignalCtrlC.exe and SendSignalCtrlC64.exe inside a virtual machine to be safe.

it is kinda of creepy to use some unknown and unsigned .exe and not know where it came from other then a dropbox and its unintended consequences.

what is the exact version of micro$oft windows on your system?

here is what always happens with those .exe

tasklist /fi "imagename eq rclone.1.49.4.exe"

Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
rclone.1.49.4.exe 13412 Console 1 24,392 K

SendSignalCtrlC.exe 13412
Sending ctrl-c signal to process 13412...
CreateRemoteThread failed with 0x00000005.
StartRemoteThread failed with 0x00000005.
0x00000005 == (FormatMessage failed)

I do not run anymore anything outside a virtual machine... with a good snapshot strategy. Only way to be more or less safe... until someone finds a way to filtrate from the guest to the host... but that is a different league...

Yes, using dark code is uneasy. No signal from malware to date from the exes pointed to. But I remember having seen a pointer to the source.

Anyhow, today there are fresher references if you are a coder; seems to be a very popular topic indeed...

Have you had a view to https://github.com/alirdn/windows-kill ?

https://stackoverflow.com/questions/813086/can-i-send-a-ctrl-c-sigint-to-an-application-on-windows looks providing also good pointings.


I have it running somewhere in one VM, will try to locate it.

so you are like me, paranoid!

thanks, i will check out those links.

If you google for the error you find interesting answers; some point to using a 32bit signal to a 64bits process or reverse. Others to waiting for confirmation (Y/N) that you cannot see. Others to not having privileges enought to kill the process.

Interesting is

It shows

>SendSignal 26320
Sending signal to process 26320...
CreateRemoteThread failed with 0x00000005.
StartRemoteThread failed with 0x00000005.
0x00000005 == Access is denied.

finally.. the answer:

"windows-kill worked perfectly and managed to resolve access denial issues faced with SendSignal. A privileged user would have to run it as well of course."

Finally, this looks as the initial sendsignal code:

But windows-kill seems the most promising way for you.


Just for the record.
Issue is now deprecated in relation to programatically killing the mount, as rclone developed such capability via rc - see https://github.com/rclone/rclone/issues/3575
On the other hand, thread provides ways to solve batch handling of mounts and unmounts.

1 Like

For anyone interested in mounts using windows Batch Scripts, I can confirm that mounts can be mounted with rclone [even with hidden consoles using CMDOW (free) - https://ritchielawrence.github.io/cmdow/ ] and can be killed either with taskkill or using windows-kill - sends ctrl-C signal see https://github.com/alirdn/windows-kill

Note that depending on how the mount is launched, you will be able to kill the window that equates to sending a ctrl-C signal or will need to kill the process by PID.

Note that CMDOW allows to use window handlers instead of window titles, as well as to know the PID of the process that opened a window (even hidden), so any operation can be done even to hidden consoles...

In practice, my bats mount a remote and open an explorer in the mounted folder; mounting is behind the curtains using hidden consoles. Then, when I am not interested in that mount, I launch another bat that destroys the explorer window and unmounts cleanly the remote.

For me SendSignalCtrlC64.exe works as well as windows-kill; I recommend windows-kill that is open source. For SendSignalCtrlC64.exe see previous post.

Other utilities can be used to launch hidden consoles, such as hstart (shareware) but I have not found any benefits on top of cmdow.

Note that my set up involves administrative privileges. Some operations might not work without them, or might, but I have not tested them.


1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.