Skip to content

Conversation

@learncold
Copy link
Contributor

Resolved / Related Issues

This PR fixes an issue where drag-and-drop was not possible for files onto shortcuts (.lnk) of script files (e.g. .bat).

Previously, dragging a file over a script shortcut would show a "forbidden" icon (looks like 🚫). This fix allows the drop to be accepted and executes the script as intended.

Steps used to test these changes

  1. Create a test.bat file in a test folder with the following content:
@echo off
echo Dropped file path: %1
pause
  1. Create a shortcut to the test.bat file in the same folder (e.g., test.bat - Shortcut.lnk).
  2. Create an empty text file named data.txt in the same folder.
  3. Drag the data.txt file and hover it over the test.bat - Shortcut.lnk file.
  4. Verify: Confirm that the "forbidden" icon is gone and the cursor indicates that a drop is allowed.
  5. Drop the data.txt file onto the shortcut.
  6. Verify: Confirm that a console window appears, displays the message Dropped file path: [Full Path to data.txt], and is now paused, awaiting input.

@yaira2 yaira2 added the ready for review Pull requests that are ready for review label Nov 6, 2025
@yaira2 yaira2 changed the title Fix: Allow drag-and-drop onto script shortcuts Fix: Fixed support for drag & drop onto shortcuts to script files Nov 6, 2025
@yaira2 yaira2 changed the title Fix: Fixed support for drag & drop onto shortcuts to script files Fix: Fixed drag & drop support with script shortcuts Nov 6, 2025
@yaira2 yaira2 changed the title Fix: Fixed drag & drop support with script shortcuts Fix: Fixed drag & drop support for script shortcuts Nov 6, 2025
@yaira2
Copy link
Member

yaira2 commented Nov 6, 2025

I can confirm this fixes the issue.

@learncold
Copy link
Contributor Author

Thanks for the feedback. I've now applied the same fix to GitShortcutItem as well.

Signed-off-by: Yair <39923744+yaira2@users.noreply.github.com>
Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed ready for review Pull requests that are ready for review labels Nov 7, 2025
@yaira2 yaira2 merged commit 8a25007 into files-community:main Nov 7, 2025
21 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Pull requests that are approved and ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Drag and drop onto file shortcuts is not working

2 participants