Windows / How to have quick action Get Sharable Link from mounted drive

What is the problem you are having with rclone?

No problem with rclone itself

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)

Windows 10, 64 bits

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

Google Drive / Shared With Me

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

get-sharable-link.bat

@echo off
set path=%1
set lastpart=%path:~3%
echo %lastpart%

rclone link CrackDrive:%lastpart% --config "C:\tools\rclone\rclone.conf"

I'm trying to create a "quick action" from right click : Get Sharable Link.

So Far, I've created a Computer\HKEY_CLASSES_ROOT\*\shell\Get Sharable Link\command key with value : cmd.exe /c /k get-sharable-link.bat %1 | clip

The get-sharable-link.bat is above.

However, this is not cliping anything, It works when I run the command without the "quick action", but not with it, did anyone achieved this already ?

I remove the first 3 chars of the path because it does contains Z:/my/super/path.

Thanks again.

hello and welcome to the forum,

here is what i did
set the regedit to c:\data\rclone\scripts\rr\other\clippy.cmd %1

and this is clippy.cmd

set path=%1
rclone link CrackDrive:%path:~3% | c:\windows\system32\clip.exe
1 Like

Hey ! Thanks :slight_smile:

I've set the key value to c:\tools\rclone\get-sharable-link.cmd %1, which seems to works since the script is launched in a new cmd when I execute Get Sharable Link on a file.

The link is well copied on the clip board if I call the script from a cmd.exe : c:\tools\rclone\get-sharable-link.cmd Z:/Romain.

But when I click on Get Sharable Link, there is nothing in the clipboard after that (I mean there is a blank string I guess).

I copied the script you gave me :

set path=%1
C:\tools\rclone\rclone.exe link CrackDrive:%path:~3% --config "C:\tools\rclone\rclone.conf" | c:\windows\system32\clip.exe

to better see what is going on, add a pause to the end of the batch file.

is Z:/Romain a folder or file?

1 Like

The pause helped me a lot since I could see I'm not authorized to do this action on files (don't know why it worked for folder tho).

The issue was from the authorized scopes in my OAuth.

After checking the metadatas scope, it worked.

Thanks :slight_smile:

great,
with rclone, best to use a log file with debug level output.

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