1

Well, There is an application called QRCP which can share files through LAN by Qr Code. It uses a command in cmd to share the file:

qrcp help

I want to add this to SendTo dropdown menu, but the problem is I can't pass it the file that I want to share.

I need something like this:

shortcut

Which I could pass the file location with %1 and the final command should be like
qrcp send "D:\Program Files\file.exe"

But it seems it's not how it works!

Shayan.Jpr
  • 13
  • 4
  • And how about create a shortcut on `SendTo` Folder ? – Hackoo Jan 26 '23 at 09:42
  • ..like [this](https://www.intowindows.com/how-to-add-folders-to-send-to-menu-in-windows-10/#:~:text=Customize%20the%20Send%20to%20menu%20in%20Windows%2010,program%20shortcut%20on%20your%20desktop.) – Gerhard Jan 26 '23 at 09:48
  • 1
    The information you've shown, states that the command must be ```qrcp [command]```, or ```qrcp [flags]```. However you seem to be trying to use ```qrcp [file]```. – Compo Jan 26 '23 at 11:13
  • @Hackoo It just opens qrcp without any other arguments! – Shayan.Jpr Jan 27 '23 at 08:10

1 Answers1

0

Here is an example that I tried on my side.

This batch file can create a shortcut on SendTo Folder and may be can do the trick for you too , just change the path of QRCP on your side :


@echo off
Title QRCP Batch File
REM Create a shortcut on SendTo Folder
REM "Call :CreateShortcut_SendTo" - This command calls the CreateShortcut_SendTo subroutine,
REM which creates a shortcut in the SendTo folder that can be used to easily execute the script.
Call :CreateShortcut_SendTo
REM This command sets the QRCP_Path variable to the location of the QRCP.exe file in the same directory as the batch file.
Set QRCP_Path="%~dp0QRCP.exe"
Set FilePath=%1

If "%FilePath%" == "" (
    Color 0C & echo No File was passed throw this Program, Exiting ... & Timeout /T 5 /NoBreak>nul & Exit
)

%QRCP_Path% %1
echo File %1 passed to QRCP
Exit /B

::---------------------------------------------------------------------------------------------------
:CreateShortcut_SendTo
Powershell -Command "If (Test-Path '%Appdata%\Microsoft\Windows\SendTo\%~n0.lnk') { Remove-Item '%Appdata%\Microsoft\Windows\SendTo\%~n0.lnk' }"
Powershell ^
"$s=(New-Object -COM WScript.Shell).CreateShortcut('%Appdata%\Microsoft\Windows\SendTo\%~n0.lnk'); ^
$s.TargetPath='%~dpnx0'; ^
$s.WorkingDirectory='%~dp0'; ^
$s.IconLocation='%QRCP_Path%,0'; ^
$s.Save()"
Exit /B
::---------------------------------------------------------------------------------------------------
Hackoo
  • 18,337
  • 3
  • 40
  • 70
  • With a little bit of editing, It worked. But it creates a shortcut of it's own bat file, not the one I passed with send to! – Shayan.Jpr Jan 27 '23 at 08:43
  • Of course and this what should be to do when you pass any file to the shortcut it will work what you want ! – Hackoo Jan 27 '23 at 09:26
  • but this shortcut is created in Send To folder, not in the directory we are working with! – Shayan.Jpr Jan 28 '23 at 10:13
  • When you right-click over a file and send to the shortcut it will execute the batch file with the file passed as argument, just try it and tell me the result ? – Hackoo Jan 28 '23 at 10:47