xxxxxxxxxx
const { execSync } = require('child_process');
const output = execSync('ls', { encoding: 'utf-8' });
console.log('The output is:');
console.log(output);
xxxxxxxxxx
var objShell = new ActiveXObject("Shell.Application");
objShell.ShellExecute("cmd.exe", "C: cd C:\\pr main.exe blablafile.txt auto", "C:\\WINDOWS\\system32", "open", "1");
//NOTE: ONLY WORKS ON WINDOWS AS I KNOW OF
xxxxxxxxxx
try {
exec(CMD, (error, stdout, stderr) => {
if (error) {
console.log(error);
}
if (stdout) {
console.log(`out of the command : ${stdout}`);
}
if (stderr) {
console.log(`error with cmd : ${stderr}`);
return;
}
});
} catch {
console.log('error with cmd: cmd dosent launch');
}