JScript.Net 编译器错误
- 我创建一个包含 print("Hello World!"); 的 .js 文件
- 我将其另存为 hello.js
- 我打开 Visual Studio 2008 命令提示符
- jsc + Enter
- jsc \out:hello.exe C:\path\to\my\file.js + Enter
我收到 E_ACCESSDENIED 错误: 会是什么呢?
谢谢!
- I create a .js file containing print("Hello World!");
- I save it as hello.js
- I open the Visual Studio 2008 Command Prompt
- jsc + Enter
- jsc \out:hello.exe C:\path\to\my\file.js + Enter
I get an E_ACCESSDENIED error:
what could it be?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您正在运行 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 folderC:\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