To do this, launch the Registry Editor by typing regedit.exe in the Start menu (or press Windows key + R > regedit.exe). These new files use the same names as the original ones with the “- Copy” suffix.ĭisabling this behavior isn’t possible, but instead, what users can do is actually change the drag distance before the aforementioned context menu is triggered.īasically, Windows allows you to adjust the drag threshold for such actions, so a copy operation would technically require a long drag and drop before the copying takes place. However, if the CTRL key is pressed and the drag and drop gesture is invoked, Windows automatically creates a copy of all selected files in the same location. In Windows, selecting multiple files can be done either with the mouse or by pressing CTRL and then clicking each item individually. To do this for multiple files, users first need to select them. The file management context menu is mistaken by many users for the standard mouse left click, whose purpose is to just to move files from one location to another with just a drag and drop. However, this apparently simple approach leads to other issues that some users have been experiencing for several Windows releases already. In essence, these options are there to make moving and copying files easier because you just need to drag and drop the items to be transferred from one location to another. One of them can be invoked by selecting one or multiple files and then drag and drop + mouse right-click in the same folder or to a different location on the system.īasically, this opens a file management context menu with just three different options: copy here, move here, and create shortcut. So in addition to the basic operations that you can do in File Explorer, like copying, deleting, and moving files from one location to another, there are also hotkeys and other shortcuts that you can use to manage your data. NOTE: As mentioned by in Windows 10, the WebBrowser.Name property returns File Explorer instead of Windows Explorer so to make it compatible for both versions you can use If wb1.Name = "Windows Explorer" or wb1.Name = "File Explorer".Despite File Explorer not being the most advanced file manager out there, Windows was developed from the very beginning to offer effortless file management across the operating system. '~~> Function to find the releavnt explorer windowįunction GetExplorer(sFolder As String) As WebBrowser '~~> The 5& is used so that any previous selections are cleared offĬall wb.document.SelectItem(sFolder & "\1.csv", 5&)Ĭall wb.document.SelectItem(sFolder & "\3.csv", 1&)Ĭall wb.document.SelectItem(sFolder & "\5.csv", 1&) '~~> We are going to select files 1,3 and 5.csv Sub SelectMultipleFiles(sFolder As String)ĭo While wb Is Nothing: Set wb = GetExplorer(sFolder): Loop SelectMultipleFiles "C:\Users\Siddharth Rout\Desktop\Test1"
Now paste the below code in a module and run the procedure Sub Sample() Next for testing purpose, we will take the folder C:\Users\Siddharth Rout\Desktop\Test1 which has 5 csv files numbered from 1 to 5 as shown below. Open a module and add a reference to Microsoft Shell Controls and Automation and Microsoft Internet Controls as shown below
Having said that, is it possible to achieve that in VBA since the API SHOpenFolderAndSelectItems is not available? The answer is You may confirm that by checking this MS KB Article There is no other option which will let you select multiple files. Unfortunately /select option will only let you select single file.