Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

file:///C:/Program%20Files%20(x86)/nodejs/public/angularjs-book-master/chapter1/order-form.html

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 at 11:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.