Autostart mount on windows without cmd popping up?

What is the problem you are having with rclone?

Just want to start my mount from login/boot without having a cmd window open. I have the batch file and when using shell:startup, it works and runs when i log in but the cmd window just stays open ready to print a log for me. Want to just get rid of it and mount only

What is your rclone version (output from rclone version)

rclone v1.53.3

  • os/arch: windows/amd64
  • go version: go1.15.5

Which OS you are using and how many bits (eg Windows 7, 64 bit)

W10 64bit

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount drive: a:

The rclone config contents with secrets removed.

no need

A log from the command with the -vv flag

no need

You can create a scheduled task to run it with. If you check "Run whether user is logged on or not", it will run hidden in background (there is a "Hidden" checkbox, but it is only to hide the task from the Task Scheduler user interface).

Alternatively, create a Windows service using NSSM or similar.

It is also possible to create a simple launcher script with WScript/VB that you can double click from Explorer, create shortcut for, add to StartUp etc, that will execute rclone normally as current user, but hidden. Simple and easy to use, but could be a bit too "naive", depending on your use case.. Example: Create a plain text file with extension .wsf, e.g. "RcloneMount.wsf", with the following content (edit in your specific rclone command line, of course):

<script language="VBScript">
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
Call WshShell.Run("rclone -with -some -options here", 0, False)

I'll just note it is possible to compile rclone so it doesn't open a CMD window when you double click it, by adding these flags to the build

-ldflags -H=windowsgui

I'm not sure if that is helpful or not though, not being enough of a Windows expert!

1 Like

you can use nircmd from the nirsoft collection of over 200 free windows tools.

nircmd exec hide c:\path\to\batchfile.cmd

This worked perfectly! I went the wsf route and everything mounts!

1 Like

Withdrawn? I dont think I did that. If so what do I do to keep it up for future reference?

sorry, i did that, as your post was about auto-start on boot.
but nirsoft has a tool for everything.

you can use nircmd from the nirsoft collection of over 200 free windows tools.

nircmd exec hide c:\path\to\batchfile.cmd

another great collection is sysinternals, including psexec, to run a command as systerm user, from a command line or script.

Got it. Ill keep this for future reference for any other projects!

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