Unexpected Issues Running Batch File

17 views
Skip to first unread message

Eddy Tippet

unread,
Nov 22, 2022, 5:58:33 PM11/22/22
to UtilFr
I have created a simple .bat file in order to move selected files and folders by accessing the Context Menu's Send To function via a .lnk file in the SendTo folder.

This method function properly as it should but when I try to run this file using Clavier+ it behaves strangely. Instead of moving the selected files to the target folder, the files are seemingly deleted and the Portable Recycle Bin folder is moved to the location of the bat file.

I assume it may be something wrong with the bat code because of it being used in a different manner than originally intended.

Can anyone help me resolving this issue?

Here is the code from the bat file in case it may help:

"@Echo Off

REM ~ Folder to move the file to
set TargetFolder="R:\Portable Recycle Bin"
set SourceFile=%1

move %SourceFile%, %TargetFolder%
pause"


Guillaume

unread,
Nov 22, 2022, 7:48:55 PM11/22/22
to UtilFr
The script seems to assume that %1 contains a source file. If I remember correctly, "Send To" sets %1, %2, etc. to the paths of the selected files. That's a custom behavior specific to "Send To" and Windows Explorer selected files.

I don't know how you configured Clavier+ to invoke the script, but unless you did something special, it's unlikely to preserve the custom "Send To" behavior. I recommend modifying your script to print the value of %1 and understand what's happening when Clavier+ invokes the script.

Anyway, this question seems unrelated to Clavier+, which behaves essentially the same way as the standard Windows "Run" dialog. So you want to find a solution that works with "Run" or by simulating keystrokes -- it's up to you to find a solution, since the question is about Windows Explorer selected files, not Clavier+ -- then configure Clavier+ to use this solution.

Eddy Tippet

unread,
Nov 23, 2022, 10:10:16 AM11/23/22
to UtilFr
It speaks volumes when a developer takes the time to respond to an issue that is not directly related to their application.

You have provided a great lead for further research!

Merci de m’avoir aidé, Guillaume!

Reply all
Reply to author
Forward
0 new messages