Reputation: 6780
I thought I could run a batch file from Notepad++ directly using nppexec by (or the built in run command) by typing CMD $(FULL_CURRENT_PATH)
But since notepad++ HAS a CMD command (which open the cmd shell in the npp console) then it is not working. So running the above command opens cmd shell in the npp console but does not run the batch file. At that point I can run $(FULL_CURRENT_PATH) AND it will run the batch file. But then I have to type exit to get our of command shell mode.
Can someone tell me how to run the batch file I am current editing in npp directly in npp.
Upvotes: 34
Views: 48117
Reputation: 41
cmd /k "cd $(CURRENT_DIRECTORY) && "$(FULL_CURRENT_PATH)"" & pause
This catches Batch files with spaces in it.
Upvotes: 4
Reputation: 71
You can use the run menu in notepad++ to create shortcuts:
With me:
"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:update /path:"$(FULL_CURRENT_PATH)"
"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:commit /path:"$(FULL_CURRENT_PATH)"
"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:lock /path:"$(FULL_CURRENT_PATH)"
"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:unlock /path:"$(FULL_CURRENT_PATH)"
"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:log /path:"$(FULL_CURRENT_PATH)"
Upvotes: 3
Reputation: 417
To run batch within its parent directory, you have to pass /d
param to cd
to change drive letter if needed and and escape paths(if contains spaces).
cmd /c "cd /d ""$(CURRENT_DIRECTORY)"" && ""$(FULL_CURRENT_PATH)"""
Upvotes: 3