Set working directory in javascript

Does anyone know how to set working directory in JavaScript before?

The code I use to run the application is as follows:

// Create an object script
oL = new ActiveXObject("WScript.Shell");
oFile = '"C:/Application.exe"';
oL.run(oFile);
+3
source share
3 answers

According to MSDN, you can use:

var oL = new ActiveXObject("WScript.Shell");
oL.CurrentDirectory = "C:\\Foo\\Bar";
oFile = '"C:\\Application.exe"';
oL.run(oFile);

... if you use this script in a Windows script Host, and in this case, you probably should make it clear in your question - about 99% of JavaScript programmers use only the language on the Internet browser, where this kind of material is possible only in extremely unusual conditions.

+10
source

Javascript , , , cwd .

( javascript, script, Rhino ..) ?

+1

Javascript dosent has access to your hard drive, so why should you set the working directory?

0
source

Source: https://habr.com/ru/post/1717331/


All Articles