Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a js file which runs node server code. ( via notepad++ using NPPExec)

enter image description here

Ok - So now the server is up and listening at http://localhost:3030

However , I have a left pane of explorer tree :

enter image description here

Goal :

  • Take the current file name
  • Calc its relative location to c:\program Files (x86)\nodejs\public folder
  • Prepend http://localhost:3030
  • run chrome.exe "http://localhost:3030/" + "/angularjs-book-master/chapter2/amail/index.html"

So , I want to run this :

NPP_RUN chrome.exe http://localhost:3030/(current file relative to nodejspublicfolder)

Notice : I want to run it as a url.

So in my example I want :

NPP_RUN chrome.exe http://localhost:3030/angularjs-book-master/chapter2/amail/index.html

Where index.html is the current displayed file.

But the problem is that I don't have merely /angularjs-book-master/chapter2/amail/index.html

I have the full value which is $(FILE_NAME) which is


And I don't need this whole string. A solution which will cut file:///C:/Program%20Files%20(x86)/nodejs/public/ from it would also be fine.

Also the slashed should be backwards.

so in short :

I have NPP_RUN "chrome.exe" $(FILE_NAME)

But this runs :

chrome.exe file:///C:/Program%20Files%20(x86)/nodejs/public/angularjs-book-master/chapter2/amail/index.html

But I want only this : (notice slashes)

chrome.exe http://localhost:3030/angularjs-book-master/chapter2/amail/index.html

share|improve this question
found it. read about set <var> ~ strreplace – Royi Namir Jan 27 '14 at 11:13

You must log in to answer this question.

Browse other questions tagged .