ioa747 Posted October 13, 2023 Share Posted October 13, 2023 This is my test program ;test11.au3 Local $iParams $iParams = $CmdLine[0] If Not $iParams Then MsgBox(0, "No $CmdLine[0]", "This means that you have run it without command line parameters") Exit EndIf Local $Str = "" For $i = 1 To $CmdLine[0] $Str &= "$iParams[" & $i & "]=" & $CmdLine[$i] & @CRLF Next MsgBox(0, "files", $Str) if I select, let's say, three files in File Explorer and I right-click and select "Open With Test", instead of opening an instance of the program with the three files selected , three instances of the program are opened and each has one file selected Whereas if I take all three file and Drag drop them onto the program icon, all three will open normally in one instance . as well as the "send to" works normally. This is my registry entry: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\Open_With_Test11] @="Open With Test" "icon"="D:\\i\\Pro\\.AutoIT\\_Test11\\test11.exe,0" [HKEY_CLASSES_ROOT\*\shell\Open_With_Test11\command] @="\"D:\\i\\Pro\\.AutoIT\\_Test11\\test11.exe\" \"%1\"" I also tried with '"D:\i\Pro\.AutoIT\_Test11\test11.exe" "%1" %*' Without any success what is the correct way, so that all selected files are opened in one instance of my program ? Any help is appreciated Thank you very much I know that I know nothing Link to comment Share on other sites More sharing options...
KaFu Posted October 13, 2023 Share Posted October 13, 2023 https://stackoverflow.com/questions/27088510/implement-explorer-contextmenu-and-pass-multiple-files-to-one-program-instance OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
ioa747 Posted October 19, 2023 Author Share Posted October 19, 2023 Thanks for the response, and sorry for the delay. I read the interesting article you post. my question was born in this post 210945-how-to-get-the-path-of-selected-files-from-explorer-windows-11 Until that moment I hadn't identified the problem because I have the FileMenu Tools installed, which it seems to be using Shell Extension so all selected files are opened in one instance of my program, and I thought this is the normal behavior Then looking for something alternative I found this https://github.com/zenden2k/context-menu-launcher which does its job just fine without using Shell extension and I figured the Autoit community would have come up with something similar or used some other way to accomplish this I know that I know nothing Link to comment Share on other sites More sharing options...
orbs Posted October 19, 2023 Share Posted October 19, 2023 2 hours ago, ioa747 said: I figured the Autoit community would have come up with something similar how about this? (i've had that piece of code running for quite some time now, but it took a few days to wrap it up nicely as a UDF). ioa747 1 Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now