Test VBS file from file UI

grayghost2
2014-04-01
2014-04-06
  • grayghost2
    grayghost2
    2014-04-01

    In other text editors to test a VBS file I have to "open" WinExplorer at the sample.vbs to run the script.

    In Notepad++ how can I run the VBS file when it is open, without resorting to WinExplorer file item.
    In Notepad2 I can run the open VBS file with a shortcut-key.

    Thank you :)

     
    Last edit: grayghost2 2014-04-06
  • Loreia2
    Loreia2
    2014-04-01

    Hi grayghost2,

    the simplest way is to press F5, and select the file. Windows should start it based on file extension. If you want more control take a look at NppExec plugin, or Python plugin if you know Python.

    BR,
    Loreia

     
  • grayghost2
    grayghost2
    2014-04-06

    Thank you Loreia for your response :)

    I am totally new to Notepad++

    F5 opens "Run..." dialog
    Using various "command-Line" strings

    I have experimented with all these path strings ...
    %SystemRoot%\System32\WScript.exe "%1" %
    %SystemRoot%\System32\WScript.exe
    C:\Windows\System32\WScript.exe "%1" %

    C:\Windows\System32\WScript.exe

    Using "C:\Windows\System32\WScript.exe" ...
    Saved "Run" setting as "VBS Run" (with shortcut keys "Alt+R")
    With a vbs file open (and active) ...
    Alt+R : opens the "Scripting Host Settings" dialog.
    ... one page/tab "Script" with two options:-
    [ ] Stop script after specified number of seconds
    [x] Display logo when script executed in command console
    '----------
    With vbs file open ...
    F5 shows the "Run" dialog ... and when I click "Run" button
    opens the "Scripting Host Settings" dialog.
    ... one page/tab "Script" with two options:-
    [ ] Stop script after specified number of seconds
    [x] Display logo when script executed in command console
    '----------
    At one point experimenting with WScript.exe full-name strings I also got this alert ...

    There is no extension in ... "C:\MyDownloads\Notepad++\extracted\%1"

    The path is to where I Notepad++ (portable) is located

    What am I doing wrong ?
    So frustrating, I have a backlog of scripts to write and determined to use "Notepad++"
    I had hoped I could run the vbs file from the notepad++ UI with shortcut keys, as I can in Notepad2 (the latter has too many shortcomings)

    I am very grateful for any help

    Thank you :)

     
  • grayghost2
    grayghost2
    2014-04-06

    I have installed NPPexec and read the "Help" file.
    I am still none the wiser. All martian to me.
    Looks like it is quicker to run a vbs file via win-explorer than to type a command in "Console"
    I have used cmd about 5 times in 20 odd years. I am a grade #1 dummy.