6

I have installed Scriptcs to Sublime Text 3.
I get this error when I press CTRL B and build my aspx page.

'scriptcs' is not recognized as an internal or external command, operable program or batch file.

I'm trying to run my aspx page on Sublime.
How can I fix this ? Thanks.

Bengi Besçeli
  • 3,638
  • 12
  • 53
  • 87
  • Can you include in your question the result of doing `where scriptcs` in a command prompt and the diagnostic output from the output panel that comes along with the error you mention above? – OdatNurd Mar 05 '19 at 23:47

2 Answers2

6

You need to add scriptcs to you PATH environmental variable, otherwise the system cannot find the executable.

The process is described in the ScriptCS documentation:

For simplicity, we will be using the Chocolatey Nuget method of installation. Copy and paste the following command into your console. This will execute a PowerShell script that will download Chocolatey, place it on your local drive, and configure your path. Make sure to reload your session so your new path is loaded.

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

Next execute the following command in your console. This will download ScriptCS, place it on your local drive, and configure your path. Make sure to reload your session again so your new path is loaded.

cinst scriptcs

If you prefer adding scriptcs to your PATH manually (or simply want to get a better general understanding of PATH), have a look at this excellent answer.

idleberg
  • 12,634
  • 7
  • 43
  • 70
  • Thanks but I have been installed Scriptcs. I get error on running. – Bengi Besçeli Feb 26 '19 at 20:13
  • 1
    I know you have installed `scriptcs`, but that's not enough. The Sublime Text package has no means to know *where* `scriptcs` is installed unless you add it to your PATH environmental variable. Once it's in your PATH you can run it from anywhere. – idleberg Feb 26 '19 at 20:28
  • Read the answer at the second link I've posted, it describes the purpose of PATH perfectly. – idleberg Feb 26 '19 at 20:29
  • Sorry if I misunderstood but I think I already installed correctly with command line - I used cmd. – Bengi Besçeli Feb 26 '19 at 20:34
  • When you open the command prompt (or PowerShell) and execute `scriptcs`, do you get the same error as from Sublime Text. If so, then `scriptcs` is not in your PATH – idleberg Feb 26 '19 at 20:36
  • No no, in cmd, its properly done, I get the error on Sublime Text when I build my aspx page. While I'm using Tools - Build – Bengi Besçeli Feb 26 '19 at 20:52
-1

Please try installing SublimeREPL and then select scriptcs from the available options. Once selected, try building the using ctrl+alt+B. https://sublimerepl.readthedocs.io/en/latest/

Sukrut Shishupal
  • 138
  • 1
  • 12