Passing filenames to batch files in context menus




















Page 1 of 2 1 2 Next. A question: I want a right click context menu item for Windows Explorer that carries out an action on all of the files that are currently selected.

Can I do that through AHK? But I've found no variables built into the registry that work for multiple files. Let me know if you are serious about this.. There will be no use if I write an example and you do not try it!

Get registered - post here again - Send me a Private Message! It can be good, it can be bad, eg. Thanks for the clarification! One alternative that I like is to create a hotkey instead of right-clicking the files. To use it, go into Explorer or Search companion, etc. The script will display the full path and name of each file you had selected. Thanks for the replies! Chris, your first script works fine. But I'm very used to working through the context menu.

So I tried to adapt it by creating a context menu action that triggers the script I removed the hotkey line " z:: " to make it carry out the script on start. This works, but as PhiLho said the action is carried out once for each selected file. Can I somehow make a script single instance?

If so, I a workaround would be to grab the file path's in the first round and then just ignore the rest. After that, we can do whatever AutoHotKey can do with the files. A possible way in AHK is to add a small delay at the start to avoid process started but having not displayed a window yet : the first script gets the filenames the way Chris described, the others detect the first script and just exit.

PhiLho: "add a small delay at the start" I tried with a Sleep command but that didn't seem to work. Did you mean something else? Or if the default ProgID is changed, your modifications will no longer be in effect. Each has a String Value Named :" Default " with the Value of the text that should appear in the context menu. The ampersand can be placed anywhere in the text and the letter the Ampersand is infront of will define that shortcut letter.

Within each unique shell folder named key there will be a subkey folder named " command " which will contain a String Value Named: " Default " with the value of the command to execute when this menu item is selected and executed.

The context Menu Handlers open a seperate instance of the defined command for all selected files when the command is selected. To access the SendTo section in an explorer type shell:sendto and the Folder containing the sendto commands will open. Within there one could creat a BAT ch file for handling the multiple arguments just as previously described. This opens a command window and keeps it open so that you can see what is being actually passed to the command line.

Skip to content. Sign in Sign up. Instantly share code, notes, and snippets. Last active Jun 7, Windows Currently I have an item on my right-click menu that runs a program and opens the file I right-clicked on. Also, how do I stop the dos box from appearing briefly when the batch file is run?

If I run it from a shortcut I can set it to minimize, but how do I stop pskill from displaying the box without a shortcut? Instead of a batch file create a compiled AutoIt script 42K which will perform the same functionality that batch will. Here is AutoIt



0コメント

  • 1000 / 1000