从批处理脚本调用javascript文件

时间:2022-05-25 23:31:01

Okay, so I have one batch script which I want to run on start-up without opening the command window, so I wrote a JavaScript file which does this, but the computer I want to run it on doesn't run JavaScript files on start-up, but it does run batch files! So my question is:

好的,所以我有一个批处理脚本,我想在启动时运行而不打开命令窗口,所以我写了一个JavaScript文件来执行此操作,但我想运行它的计算机不会在启动时运行JavaScript文件,但它确实运行批处理文件!所以我的问题是:

-Is it possible to call a JavaScript file from a batch script, and how?

- 是否可以从批处理脚本调用JavaScript文件,以及如何?

2 个解决方案

#1


0  

Sounds like you want to install node.js

听起来好像要安装node.js

#2


0  

You can use Mozillas Rhino: https://developer.mozilla.org/en-US/docs/Rhino

您可以使用Mozillas Rhino:https://developer.mozilla.org/en-US/docs/Rhino

You can use the js scripts from batch like you would do with python ones

您可以像使用python那样使用批处理中的js脚本

$ rhino file.js

#1


0  

Sounds like you want to install node.js

听起来好像要安装node.js

#2


0  

You can use Mozillas Rhino: https://developer.mozilla.org/en-US/docs/Rhino

您可以使用Mozillas Rhino:https://developer.mozilla.org/en-US/docs/Rhino

You can use the js scripts from batch like you would do with python ones

您可以像使用python那样使用批处理中的js脚本

$ rhino file.js