Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

65
Views
Electron javascript run batch command

I need to run a batch command in electron.

i try it. i have btn timeout and after click i need run cmd batch script. This code but no run batch

document.getElementById('timeout').addEventListener('click', function (e){
    timeout();
});
function timeout()
{
    const {shell} = require('electron');
    shell.Run('cmd /c start TIMEOUT /T 10');
}

Thank you for your advice.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try this method. Note that it requires nodeIntegration to be enabled, or for you to run the command from the main process.

const { exec } = require('child_process');
exec('cmd /c start TIMEOUT /T 10');

The shell module from Electron is not a shell in the sense you're thinking.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!