8

How can I disable copying files via drag-and-drop in Windows Explorer in Windows 7?

Note that I don't want to disable drag-and-drop completely nor in the start menu, just disable copying (duplicating) files when users drag-and-drop.

  • In a GUI OS, drag-and-drop is at the heart of the process. If you wish to move the files rather than copy, that is another matter but you cannot simply tell the system to not copy files unless you prevent doing so with file permissions. If it is an accessibility issue there are tools. What are you trying to accomplish in preventing files from being copied? – edwardbackstrom Jun 3 '13 at 3:25
  • About half my PC clients have 'copy of ...' files and I've seen as much as a full GB of duplicate files. – John Jun 3 '13 at 3:55
  • 1
    Just search for and delete "Copy of..." files. Script it out and run it regularly. ;) – Ƭᴇcʜιᴇ007 Jun 3 '13 at 4:00
  • 3
    That's funny, I thought the real problem was MOVE drag and drop, you know moving network folders accidentally and getting complaints about "disappeared folders". COPY happens when moving things from a drive to another, otherwise the default is MOVE. So why would your users drag things between drives? It doesn't sound like accidental misclicks. If users are trying to move things between various network shares, why not consider combining them into one large (virtual) drive? Etc. Perhaps there's some root cause factor here. – mtone Jun 3 '13 at 5:58
4

Windows doesn't provide a built-in way to change the default action of drag and drop, but I found a tool called Drag'n'Drop Editor which will let you change the default action to "move".

This doesn't disable copying (you can still hold Ctrl to make a copy), but it should help prevent accidental copies.

  • I prefer to use default windows setting by holding ctrl/alt to copy or create shortcut – Mohamed Slama Nov 6 '17 at 16:38
7

What: Prevent accidental drag-drop when you are trying to open a folder with a double click.

Why: You double-click to open a folder, but Mouse moves between the two clicks, Explorer assumes you are dragging a folder.

Solution: Save next 6 lines in a file named: prevent-accidental-drag-drop-in-explorer.reg, click on it to install it; restart windows; and now you will need to drag mouse a lot more to initiate drag/drop.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\Desktop]
"DragHeight"="50"
"DragWidth"="50"
  • This answer is so perfect in every way, I wish I could +100 – Luis Ferrao Oct 1 '18 at 8:49
3

I work in a large company and we had the problem of accidental dragging of folders in a shared drive. Since there is no built-in functionality in windows to prevent it and I cannot use freeware or third party things, I created a script which runs in an administrative computer with access to the shared folder in question. The script opens an invisible MS Word session and creates a file in the shared folder with a name that places it at the very top if you list the files by name in Explorer. The script finishes but leaves the Word document open in that admin computer. If someone tries to drag the folder, they get an immediate error message telling them they cannot move it because that word document is open. They also cannot delete it. Windows moves the contents of a folder in alphabetical order, that's the importance of that word document having a name that places it at the top

  • VERY clever of you! – RockPaperLizard May 15 '15 at 2:25
  • For reference, can you post the script? It would be very useful to the community to have it here. – bwDraco May 15 '15 at 18:52
  • 1
    Unfortunately it doesn't work, at least not on a Samba file server. I just tried it: 1. create a file on one computer (and keep it open, e.g. a Word document) 2. move the folder containing that file from another computer No error, the folder just gets moved. :-( – dummzeuch Aug 9 '17 at 8:56
2

You can change the default drag and drop behaviour to create a shortcut instead of copying / moving the files.

Features

  1. The folder / files stay in their original place

  2. No copying takes place, so there is no duplication of files / folders and no waste of space

  3. If you want to move of file / folder, you have to use the right mouse button and choose "move" from the context menu

  4. If a user accidently uses drag and drop a shortcut will be created. This is the only drawback, but with very little impact. Optionally you can use a script to delete shortcuts if that seems appropriate.

  5. This approach introduces consistent drag and drop behaviour, which is not the default in windows: By default, if a folder / file is dragged across filesystems, a copy is made. If the same file is dragged within the same filesystem, it is moved. While an IT expert probably knows the background and intentions of it, many users may not.

Solution

Copy this into a .reg file and run it with administrator privileges:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AllFilesystemObjects]
"DefaultDropEffect"=dword:00000004

Distribution using group policies with active directory server

Configure a group policy (translated from german, please feel free to replace it with the correct terms if they differ):

Computer configuration > Settings > Windows Settings > Registry

Tested on Windows 7 with Windows Server 2012

Comment on the solution by mosh

While setting a minimum move distance of 50 pixels looks promising first, there are some drawbacks:

  1. The behaviour is not transparent to the users. One user might try to move a file. When he moves the file "far enough" it works. When the folder is nearby, the move doesn't work. The approach breaks the user interface with "inconsistent behaviour".

  2. A quick user can accidently drag 51 pixels - in the end there's no proper value to set for the distance. Too small - no effect. Too big - broken move function.

  • A suggestion to improve your answer. Remove the commentary. As somebody reading your answer, I don't care you don't have the reptuation to comment. Your answer should do one thing, answer the question, you shouldn't be directing your answer to any specific user. You don't have to indicate when you added something, the revision history, exists for that reason. – Ramhound Nov 28 '16 at 14:30
  • Thanks for your suggestion, I removed the line about the reputation. – ChristophK Nov 29 '16 at 9:22
  • I left the comment itself for the following reason: While my answer comes pretty close to the solution, it's not 100% on the spot. I agree that a clear question and a clear answer would be the best thing, but in reality this doesn't always work. All the answers here are workarounds with specific advantages and disadvantages. The reader has to make a choice what workaround suits best for his or her environment. By poiting at the disadvantages of the 50 pixel solution, I try to make available more information to support that choice. – ChristophK Nov 29 '16 at 9:41
-1

Perform the following steps :

  1. RIGHT click on start button
  2. select Properties
  3. in "Taskbar and start menu properies" select the "Start Menu" Tab
  4. Select "Customize" (doesnt matter if you are using the classic or general style)
  5. Click on advance and scroll to search "Enable Drag and drop"
  6. Uncheck it
  7. Click Apply.

This should do the trick.

  • 2
    although this does prevent files from being "copied" to the start menu, it does not answer the OP's apparent question of preventing files being copied via Explorer. – edwardbackstrom Jun 3 '13 at 3:48

protected by Community Dec 7 '15 at 7:26

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.