Sublime Forum

I can't get command build to work on windows

#1

I tried to build a new system in sublime text 3 in order to preview my code however it is not working. This is what I wrote { “cmd”: ["\Users\Public\Public Destop" “$file”] } . But I am not sure it is the write code or where exactly to save it on my computer. I have a windows computer as well.

0 Likes

#2

I fixed my code to look like this in the new system {
“cmd”: [“‪C:\Program Files\Google\Chrome\Application\chrome.exe”, “$file”]
}
and i set it to say chrome however when i do control b it will not build and comes out with this error
[WinError 2] The system cannot find the file specified
[cmd: [’\u202aC:\Program Files\Google\Chrome\Application\chrome.exe’, ‘C:\Users\Liyah\Documents\sublime\hello.html’]]
[dir: C:\Users\Liyah\Documents\sublime]
[path: C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL;C:\Program Files\Intel\Intel® Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel® Management Engine Components\IPT;C:\Program Files\Intel\Intel® Management Engine Components\IPT;C:\Users\Liyah\AppData\Local\Microsoft\WindowsApps;]
[Finished]

if someone could help me out i would really appreciate it

0 Likes

#3

Hello!

It’s a markdown-using forum

It’s more agreable to the eye if you use the code fences:

My message

with some paragraph and some code:

```myLangageName (or nothing)
# this is your code
```

continue your message

For example, you’d set your build system like so:

```json
{
    "cmd": ["‪C:\Program Files\Google\Chrome\Application\chrome.exe", "$file"]
}
```

And here’s what you’d get:

{
    "cmd": ["‪C:\Program Files\Google\Chrome\Application\chrome.exe", "$file"]
}

For your problem

I think you get this error because you need to escape your backslashes:

{
    "cmd": ["‪C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", "$file"]
}
1 Like

#4

I have back slashes and when I go to build new system is says chrome for the one I just built. However whenever I try control B I end up getting this error:

[WinError 2] The system cannot find the file specified
[cmd: [’\u202aC:\Program Files\Google\Chrome\Application\chrome.exe’, ‘C:\Users\Liyah\Documents\sublime\getinvolved.html’]]
[dir: C:\Users\Liyah\Documents\sublime]
[path: C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL;C:\Program Files\Intel\Intel® Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel® Management Engine Components\IPT;C:\Program Files\Intel\Intel® Management Engine Components\IPT;C:\Users\Liyah\AppData\Local\Microsoft\WindowsApps;]
[Finished]

0 Likes

#5

Can you post your updated build system after implementing the changes that @math2001 mentioned in his post? (also, please at least select the text of your output and mark it as preformatted text using the button in the post editor, it’s very hard to read otherwise).

The error message says that the command to be executed is:

[cmd: [’\u202aC:\Program Files\Google\Chrome\Application\chrome.exe’, ‘C:\Users\Liyah\Documents\sublime\getinvolved.html’]]

Notice that the first thing in the command name is \u202a, which is a Unicode control character for Bidi text control. I don’t know from Unicode or languages that need bidirectional controls, but none of the other paths in the output have that control character so it seems likely that might also be an issue.

0 Likes

#6

Well here is my updated

{
"cmd": ["‪C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", "$file"]
}

And are you saying I have to add the control character \u202a to this statement to get it to work?

0 Likes

#7

No, sublime is reporting that it’s there, so that may be the issue. It doesn’t visibly look like it’s in your setting, but being a control character it might be invisible. It may help to manually retype the line to make sure that it’s not in there (e.g. if it got there because you copied and pasted from somewhere that had it or something).

0 Likes

#8

okay i retyped it and this new error came in

[WinError 2] The system cannot find the file specified
[cmd: ['C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe', 'C:\\Users\\Liyah\\Documents\\sublime\\getinvolved.html']]
[dir: C:\Users\Liyah\Documents\sublime]
[path: C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Users\Liyah\AppData\Local\Microsoft\WindowsApps;]
[Finished]

However I did save it in my users file

0 Likes

#9

Are you sure that’s where Chrome is installed? On this Windows 7 machine, the location of my chrome install is in Program Files (x86) and not Program Files (even though it’s a 64 bit machine).

The following works for me. Here I’m using forward slashes instead of backslashes so that I don’t have to double them up, and I’ve included a selector so that the build is automatically selected for html files.

{
    "cmd": ["C:/Program Files (x86)/Google/Chrome/Application/chrome.exe", "$file"],
    "selector": "text.html"
}
0 Likes