According to the rclone mount document:
“It is also possible to start a drive from the SYSTEM account (using the WinFsp.Launcher infrastructure) which creates drives accessible for everyone on the system.”
I tried to edit the registry for WinFsp.Launcher to include rclone but it didn’t work. Anyone with experience or instruction about how to make Windows 10 system launch rclone mount as a service?
(I need this because some old apps need to run as Administrator on Windows 10, while some others such as Windows Explorer are more troublesome to run as Administrator on Windows 10, while not impossible. For example, I used autohotkey to launch Windows Explorer as Administrator on Windows for the Win E key, but it’s not reliable. Anyway the rclone mounted drive needs to be accessible by both normal user and Adm account, hence the question.)
nssm works! It simply works! Thank you spicypixel!
Now my mounted rclone Google drive on Windows can be seen by both the user accounts and administrator account.
It’s quite straightforward. The following experience for others in case useful, while most people would be able to figure them out fairly easily:
To install the rclone service, need to specify the config file location in the parameter, because it’s starting from the system account, not a user account.
It might also help to configure the timeout for shutting down and restart the service longer. I set it as 10 seconds and have no problem so far.
To change the parameters of rclone after installation, use regedit.exe to edit the registry:
\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RCLONE SERVICE NAME\Parameters
(Browse to it or simply search the keyword of your rclone service in the registry.)
After downloading nssm, I simply put nssm.exe in the same folder as rclone. Then, I use the nssm GUI to configure rclone as a Windows service: nssm GUI
Remember to put all the rclone arguments in the “Arguments” field.
Note that when registering rclone as a Windows service, you need to explicitly specify the location of rclone’s config file (e.g. --config=“C:\Program Files\rclone\rclone.conf” ), because rclone is being started by the system account, not a user account anymore, so the default folder for conf file could be different from where you used to put the config file before.
After the configuration, it will automatically start upon reboot. You can also run “services.msc” to stop/start/restart the service whenever you want.
thank you for the reply:
my rclone config file is located here should i move at to the main rclone folder with NSSM ?
and do i put the command for rclone mount in the config file or in NSSM ?
Can you show me a screen shot of how you are doing at in more detail ?
sorry for all the small questions but this is very new to me.
Copy nssm.exe to same directory that rclone is in. I launched NSSM, by opening an elevated command line. Type cmd in the search bar and right click and choose “run as administrator.”
cd c:\rclone (or wherever you have rclone located)
nssm install “Rclone Mount”
Fill in the info below
Still in the command prompt, type services.msc
Scroll down and choose your service and right click and start it.
If it fails to start, stop the service
Go back to command prompt and run sc.exe delete “Rclone Mount”
Enter the command from step 2 above and repeat until you complete everything with no typos and it works.
Going to post the various parts of NSSM that I’ve filled in. Originally it was failing because when I did the copy paste, for some reason it was doing one dash and one hyphen. I could paste it to command line and it would work. But to NSSM it would change it to hyphen. So I ended up just typing it out, instead of copy paste.
Application tab: Path: C:\rclone\rclone.exe Startup Directory: C:\rclone Arguments: mount gdrive-crypt: s: --config “C:\rclone\rclone.conf” Service name: Rclone Mount
Details tab: Display name: Rclone Mount Description: Automatically mounts the encrypted google drive using rclone.
Exit actions tab: Delay restart by: 10000 ms (10 seconds)
If I didn’t reference it above, I didn’t change it away from defaults.
mfmaa03, you don’t need to move your config file. Just use the --config argument to tell rclone to look for the config file in the right directory. Even if you move your config file to the program directory, you still need to use the --config argument because the system account might look for the config file in another directory by default.