JScript.Net 编译器错误

发布于 2024-07-12 04:22:09 字数 258 浏览 4 评论 0原文

  1. 我创建一个包含 print("Hello World!"); 的 .js 文件
  2. 我将其另存为 hello.js
  3. 我打开 Visual Studio 2008 命令提示符
  4. jsc + Enter
  5. jsc \out:hello.exe C:\path\to\my\file.js + Enter

我收到 E_ACCESSDENIED 错误: 会是什么呢?

谢谢!

  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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

纸伞微斜 2024-07-19 04:22:09

听起来您正在运行 Vista 或 Windows 2008。VS2008 命令提示符可能在 C:\Program Files\Microsoft Visual Studio 9.0\VC> 中打开。

您的 /out:hello.exe 开关未指定路径,因此编译器尝试将编译后的 exe 写入当前工作文件夹 C:\Program Files\Microsoft Visual Studio 9.0\如果没有提升的权限(即以管理员身份运行),则不允许使用 VC>

解决方案是指定与源文件相同的可写路径:

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

,如果您运行的是 64 位 Windows,则命令提示符的工作文件夹路径为:C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文