vyger
vyger

Reputation:

JScript.Net compiler error

  1. I create a .js file containing print("Hello World!");
  2. I save it as hello.js
  3. I open the Visual Studio 2008 Command Prompt
  4. jsc + Enter
  5. jsc \out:hello.exe C:\path\to\my\file.js + Enter

I get an E_ACCESSDENIED error: what could it be?

Thanks!

Upvotes: 0

Views: 269

Answers (1)

Kev
Kev

Reputation: 119806

Sounds like you're running Vista or Windows 2008. The VS2008 command prompt is probably opening in C:\Program Files\Microsoft Visual Studio 9.0\VC>.

Your /out:hello.exe switch doesn't specify a path so the compiler is trying to write the compiled exe to the current working folder C:\Program Files\Microsoft Visual Studio 9.0\VC> which isn't permitted with out elevated rights (i.e. Run As Administrator).

The solution would be to specify the same path as your source file which is writable:

jsc /out:C:\path\to\my\hello.exe C:\path\to\my\file.js

Finally, if you're running 64 bit windows then the working folder path for the command prompt would be: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC

Upvotes: 1

Related Questions