@Alan-Kilborn wrote:
this tells me your Notepad++ is fairly out of date.
Not necessarily. As a reminder, the updater does not overwrite existing config files. So it really says that the version currently being used had been updated from an installation that still had those launch-in-browser commands.
@Salvador-Garcia said in Launching .BAT file with paramater:
v7.9.1 Win 32 bit
Update: When I chose to update Notepad++, I get a message indicating that there are no updates. ???
v7.9.1 is the most recent Notepad++ that has had the auto-update triggered (and came long after the launch-in-browser commands were removed from the Run menu). v7.9.2 and v7.9.3 were never deemed stable enough to push to auto-update; and v7.9.4 is still in Release Candidate (“RC”) mode.
I changed the short cut keys from Shift F5 to Alt Shift R and it worked.
I am confused. Was the problem you were having that Shift+F5 wasn’t running your user-defined-command? Or was the problem that the user-defined-command wasn’t running, even when you manually selected it from the menu, it never ran? Or was the problem that it runs the batch file just fine, but doesn’t include the path name? (I thought it was the third option, until you mentioned the Shift+F5 vs Alt+Shift+R.)
Also, you never showed the results of the experiment that @Alan-Kilborn asked you to try. And you haven’t responded to @Ekopalypse’s request for ?-menu Debug Info.
I took a fresh v7.9.1 portable (straight from the zipfile, no customizations yet), and replicated Alan’s experiment:
Exit all instances of Notepad++
Run Notepad++
Run > Run
set the program to cmd /K echo $(FULL_CURRENT_PATH) as
@Alan-Kilborn suggested
click
Save…
give it the name DebugFullCurrentPath
give it the shortcut Shift+F5
click
OK => it should be saved now
click
Cancel to exit the menu, or
Run to run the command now that you’ve saved it.
I know,
Cancel seems counter-intuitive; but since you hit the
OK already, it really did save.
typing Shift+F5 ran the command and printed the full current path. So does
Run > DebugFullCurrentPath
Looking at
Run > Modify Shortcut / Delete Command will show you whether or not you have a shortcut conflict: if you do, it will highlight the offending entry red.
if you have a conflict, that would explain why Shift+F5 didn’t work but Alt+Shift+R did “work”.
Exit all instances of Notepad++
Run Notepad++
File > Open: %AppData%\Notepad++\shortcuts.xml (see 🛈 below)<Command name="DebugFullCurrentPath" Ctrl="no" Alt="yes" Shift="no" Key="112">cmd /K echo $(FULL_CURRENT_PATH)</Command>
… so that is what I would expect
My guess is that you originally saved your Launch asm2bin command without the $(FULL_CURRENT_PATH), and that the next time, when you edited the command to be E:\CoCoDev\asm2bin.bat $(FULL_CURRENT_PATH), you forgot to Save… and assign the name. For reference, if you assign the same name, it does not overwrite the existing Run entry: it creates a duplicate – notice this screenshot (taken after reloading Notepad++, so that shortcuts.xml will be updated) shows two DebugFullCurrentPath entries in the menu and in the XML:
8debd49a-7435-42b5-af5f-368067a40e53-image.png
In the state you are in now, I would recommend
Run > Modify Shortcut / Delete Command
Click on Launch asm2bin
Click
Delete button and confirm in the next dialog
If you created the test or DebugFullCurrentPath commands that Alan and I recommended for testing, delete those as well.
Close this dialog
Exit all instances of Notepad++ and restart
Run > Run…
program = E:\CoCoDev\asm2bin.bat "$(FULL_CURRENT_PATH)"
please notice the quote marks – they are really there. The full current path might contain spaces, and your batch file probably expects the path name as a single token, not multiple, so using quotes will make sure that the space is considered part of the filename.
Save…, use your Launch asm2bin name, and whatever shortcut you desire
OK to save
Now you can
Cancel to exit dialog without running
Check the
Run menu to make sure Launch asm2bin has been re-created
Check
Run > Modify Shortcut / Delete Command to make sure that Launch asm2bin doesn’t have a conflicting shortcut
Try running it, both from the
Run > Launch asm2bin menu, and using your keyboard shortcut.
If all is well, great! Otherwise continue
Exit Notepad++ and restart.
File > Open: %AppData%\Notepad++\shortcuts.xml, and the Launch asm2bin entry should look more like<Command name="Launch asm2bin" Ctrl="no" Alt="no" Shift="yes" Key="116">E:\CoCoDev\asm2bin.bat "$(FULL_CURRENT_PATH)"</Command>
Note, the detailed steps that I outlined have always worked for me in Notepad++, no bugs ever shown, for as long as I can remember.
If it still doesn’t, please show us what’s in your shortcuts.xml, and explain in your own words exactly what you did to get there. If you have a screen-recording app like ScreenToGif you can create an animated gif of the full process, and save/upload to imgur.com or similar, and link it like ![](https://domain/path/file.gif) (make sure you use imgur’s .gif link, not the .gifv or the one with no extension, which will not embed an image; if you’ve done it right, the preview window on the right will show your animation running while you’re editing your post)
—
🛈 : Since you haven’t shown us your Debug Info, I am assuming you have a normal installation, where config files go in %AppData%\Notepad++ 🔗. If you have cloud settings enabled, or are using a portable edition, the shortcuts.xml file will be in a different location. But since you quoted from the shortcuts.xml already, I am hoping you know this.