08 March, 2010

Notepad++ run the script with cscript

Hi,

I needed a way to run a vbs script i was working on using Notepad++ and I all the time had to go to a cmd screen and run it.
Found a cool way to ease my pain, in the "Run" menu there is an option to save a command. Just type the following and a CMD window will open and will run the vbs in cscript.

=================================================================
cmd /k cd /d "$(CURRENT_DIRECTORY)" && Cscript "$(FILE_NAME)"
=================================================================

if you would like to leave the window open each time use the following:
=================================================================
cmd /c cd /d "$(CURRENT_DIRECTORY)" && Cscript "$(FILE_NAME)" && pause
=================================================================

Bye...

9 comments:

  1. Cheers dude!
    Thats just made my day!

    ReplyDelete
  2. Google search took me here... This worked great, thank you!

    ReplyDelete
  3. I love you man. You and Google.

    ReplyDelete
  4. Cheers Nice Thanks Man

    ReplyDelete
  5. Thanks, this was useful. If anyone is using these commands from the nppexec plugin, adding "&& exit" (w/o quotes) to the end of your command will terminate the process.

    ReplyDelete
  6. You just have to make sure you save the file before running :-D

    ReplyDelete
  7. Thank you, just what I needed!

    Mark

    ReplyDelete
  8. Thank you! Saved me countless hours

    ReplyDelete