Getting workspace path in Notepad++ run commands - command

I am using Notepad++ with workspaces, created through "Open Folder as Workspace".
I am trying to launch external command from Notepad++ using the Run command menu.
The variable FULL_CURRENT_PATH give me the current file path but I need to get the worskpace path to launch some deployment script in the root of the workspace.
Is there a variable for workspace path ?

I'm afraid there is no such variable. You can see a list of all variables in the source code of Notpad++:
https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp
You can read the Workspace directories from the configuration file, but the file will only be written if Notepad ++ is closed. Maybe someone has an idea how to trigger that
cmd /c echo. |powershell -Command [xml]$nb = Get-Content $env:appdata\Notepad++\config.xml; Write-Output $nb.NotepadPlus.FileBrowser.root.foldername

Related

How do I get Visual Studio Code to run from the directory of the Python file?

I am new to Visual Studio Code. I am using Windows.
When I hit the "Run Code" button at the top right, I want my .py file to run from the current directory.
When I hit Run right now, I get the Terminal window > Windows Powershell, which prints:
PS C:\Users\zack> python -u "c:\Users\zack\Desktop\test.py"
In other words, I want the .py file to run as if I did "cmd" then "cd directory".
I saw this question but I don't know where to type this.
I also saw this question and enabled Execute in File Dir. Didn't change anything.

VSCode Win Shortcut to Launch with Open Folder Command

I have 10 applications that I constantly work on. At times I need to open them all up separately to run bash commands on them. Is there a way I can create a windows shortcut for each folder, then I select all 10 shortcuts and click enter to initiate 10 different VSCode applications each opens up with their respective folder I set to?
(Windows 10) To open VS Code in desired directory using shortcut:
Create shortcut to Visual Code Studio app,
Right click on the shortcut and select Properties,
In Target field append your directory path (remember to use quotes " " if there are spaces in the path).
ctr + K + O
open a folder vs code most common shortcut key available all platforms same
https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf
I use a batch file like in Sean's solution. You can automatically close the terminal after launch if you use the start command rather than "code ."
Here's an example:
#echo off
cd "C:\path\to\your\project\folder\"
start "" "C:\Program Files\Microsoft VS Code\Code.exe" .
exit
Note: if you don's like how the batch file looks, you can make a shortcut to the batch file and change the shortcut's icon to the VS Code icon.
In a similar situation, I use a batch file to launch my most used vscode windows. I am not yet smart enough to make the cmd windows disappear after they open vscode, but maybe someday. In each batch file, use the following changing the directory for each project.
#ECHO OFF
cd C:\directory\where\your\project\is
code .
exit

unable to launch swift from another directory in Ubuntu

I am unable to launch swift terminal or unable to do swift build from any other directory (apart from ../swift/usr/bin ) in Ubuntu . When i am in swift folder (../swift/usr/bin) where i installed it, i am able to launch swift REPL but not from any other directory
I even exported the bin path to environment variable
export PATH=/home/vinit/swift-2.2-SNAPSHOT-2016-02-24-a-ubuntu14.04/usr/bin:$PATH
I executed this command from bin directory. And checked it with
echo $PATH
I was getting
/home/vinit/swift-2.2-SNAPSHOT-2016-02-24-a-ubuntu14.04/usr/bin:/home/vinit/.linuxbrew/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/vinit/bin:/usr/local/java/jdk1.8.0_65/bin
but when i executed the same (echo $PATH) from other directory , i am not getting swift in environment variable.
Thanks in advance.
For the swift entry in PATH to disappear, I am guessing that you restarted the terminal after you exported PATH or had more than one terminal open at a time, and tried to work simultaneously. Try putting the export command in the .bashrc file in your home folder and open a new terminal.

Batch file in eclipse path variables not found

I want to start a batch-script in my eclipse. (Instructions here: How to run a batch script (.bat file) from eclipse)
In my batch file i need some commands like pear or phing.
I put the path to these commands into my environment variable called PATH.
(Works fine with cmd manually)
After starting the script, I'm getting this error:
'pear' is not recognized as an internal or external command,
operable program or batch file.
If I type pear by hand, it doesn't work either.
You need to restart Eclipse after changing the system environment; environment variable changes requires any process that is already running to be restarted in order for that application to pick up the changes.
Another option might be to put the full path to those commands in the .bat file so that it doesn't rely on the system environment in order to work properly.
Tip: Make sure to close and start eclipse afresh for PATH variable changes to take effect. Using the Restart option in File menu may not help here.

Copy file path into clipboard by drag&dropping it into exe file

Is there any possibility to create exe file which copies path of a file into clipboard when you drag&dropp the file into the exe? How could I do it ?
Thanks
Two ways OTM in Windows:
1. Start > Run
2. Start > Run > "cmd"
in both cases, once you drag the file onto the window, its entire path will be pasted.
To do the copy, you'll have to do that manually (easier in the Run window)
To do this onto an application:
How do I drag and drop files into an application?
A just found a program called Copy Path that works for me. It adds "Copy path" to the Windows Explorer context menu (not exactly drag-and-drop, I know).