Je cherche un moyen de lancer plusieurs scripts dans un processus distinct de mon script principal, mais de manière à pouvoir accéder aux copies des variables que j'ai déclarées. Prenons l'exemple suivant:Exécution de plusieurs fichiers JScript dans un processus séparé
Serializable.js:
// Represents serializable data.
function Serializable() { /* ... */ }
SecondaryScript.wsf
// Serializable is not defined here!
FakeMoney.prototype = new Serializable();
function FakeMoney(amount) { /* ... */ }
MainScript.wsf:
<job>
<script language="JScript" src="Serializable.js"></script>
<script language="JScript">
var WshShell = new ActiveXObject("WScript.Shell");
// `Serializable` is defined here...
var oExec = WshShell.Exec("cscript SecondaryScript.js");
WScript.Echo(oExec.Status);
</script>
</job>
Existe-t-il un moyen de définir Serializable
pour le code dans SecondaryScript.js
tout en exécutant SecondaryScript.js
dans un processus distinct?