How to add a button to the context menu to copy a file to a directory


  1. PSB
    Posts : 5
    Windows 7 64 bit
       #1

    How to add a button to the context menu to copy a file to a directory


    Hi,
    I use a few different files on a very regular basis. As an example, I have an Excel file that starts out as a template which I then modify to fit the situation. I start by navigating to the location of the "template" (via a shortcut to make it quicker), copying the file and then navigating to the sub directory where I need to copy the file. It's not a huge issue, but I'd love to simply navigate to the sub directory, right click my mouse to bring up the context menu and then click on a button to copy the file to the current sub directory I'm in.

    I'm very close, but need help tweaking what I have. I created a bat file that I call from the Context menu (see below for the path I used). It works great, the only problem is that I have to click on a directory for my context button to come up. When I click on it copies my file, not into the directly I've selected, but into the current directory I'm in. This is actually good, because I'd like to be in the directory and then copy the file. The problem arises when I am in a directory that doesn't have a sub directory. In this case I have no directory to right click on and thus, I can't get my menu button to come up. I could go up one directory, click on the one I "really" want to work on, paste my file and then move the file, but I'm sure there is a better way.

    Is there a location in registry where I can create a key that will come up when I right click my mouse and bring up the context menu my custom button will appear, allow me to run my bat file and copy my file into that active directory? Thanks in advance for any help with this question.


    My current registry location:

    HKEY_ROOT_CLASSES_ROOT
    Directory
    Shell
    CostCalc (I created this)
    Command (I created this and it calls my bat file)

    My bat file:
    rem file located in this location

    Copy J:\work\ex_files\costcalc.xls
      My Computer


  2. Posts : 6,285
    Windows 10 Pro X64
       #2

    Here are some instructions I've posted to add a batch file to the right click menu. It only appears when I click on a file within a folder as far as I can tell. You can replace my stuff with yours and see what happens.

    Add Is this a link to the Windows Explorer right click Context Menu.

    Step 1:
    Create isItaLink.bat.
    Click Start, type notepad and press Enter.
    Copy and paste the following RED lines into the Notepad window:

    fsutil hardlink list %*
    pause


    Save the files as isItaLink.bat in a folder you will be keeping.

    Step 2:
    Create AddisLink.reg as follows:

    Click Start, type notepad and press Enter.
    Copy and paste the following RED lines into the Notepad window:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\*\shell\isLink]
    @="Is This a Link"

    [HKEY_CLASSES_ROOT\*\shell\isLink\command]
    @="\"C:\\
    xxxxxxxx\\isItaLink.bat\" \"%1\""

    Note: Change xxxxxxxx to the folder you put isItaLink.bat in.

    Step 3:
    Merge AddisLink.reg into you registry by double clicking on it or right clicking and select Merge.

    To use, open Windows Explorer and navigate to the file you are interested in,
    Right click on it and select Is This a Link.

    A Command Prompt window will open with the results.
      My Computer


  3. Posts : 126
    Windows 7 Pro 32bit / Windows 7 Professional
       #3

    You might add the folder in question to your SendTo folder.

    C:\Users\YOUR USER NAME\AppData\Roaming\Microsoft\Windows\SendTo

    Navigate to the SendTo folder and create a new shortcut leading to your destination folder.

    Be Well,
    RȘnce

    PS: I like to keep shortcuts to Notepad.exe and WordPad.exe in my SendTo folder as well, to quickly open files in those programs that are NOT normally associated with the text editors.
      My Computer


  4. PSB
    Posts : 5
    Windows 7 64 bit
    Thread Starter
       #4

    Thanks for both inputs. I used the suggested registry key location and it works great. Also, never knew you could modify the "Send To" folder. I'll definitely be using that trick!!
      My Computer


  5. PSB
    Posts : 5
    Windows 7 64 bit
    Thread Starter
       #5

    Hi,
    I have been using these suggestions and most times they work GREAT! However, there are times when I start with an empty folder. I doubt that I can add a shortcut to my bat files directly in the context menu that comes up when you hit the right mouse button in an empty folder. There is a sub menu entitled "NEW" that appears to be editable. Can anyone tell me if I can add my bat file short cuts to this sub menu and if so the path to its location in the registry. Thanks so much
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:17.
Find Us