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

166
Views
Multiple commands on button click callShellApplication?

in my JScript HTA script I have a button that executes a CMD command when I press it: <button onclick="callShellApplication('ipconfig')">Your IP-Adress</button> But this is only one command and I want to execute several. For example @echo hello + ipconfig, I need this because the system on which I execute the command has a CMD block, with the first command it always puts a cryptic character in front of it only with the second command is the command executed. So to get around that I want to execute two commands. How do I do that?

Best regards, jcjms

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

0

I will be critiqued for a one line answer rather than adding a full related code block but this is a minor mod from someone else's answer at https://stackoverflow.com/a/70138712/10802527

    <button onclick="callShellApplication('cmd /d /c echo/ &ipconfig')">IP-Adress</button>

It is not perfect as it throws the black console widow up for a second before feedback is captured.

My excuse for the simplistic answer is it does exactly what was requested i.e. inject an echo before calling ipconfig.

It seems there may be some Admin autorun trap in cmd chain and using /D should help avoid that if also necessary.

If the echo is needed to acknowledge an autorun message, then it will not be needed if /d stops it acting thus that line may then simplified to:-

    <button onclick="callShellApplication('cmd /d /r ipconfig /all')">IP-Adress</button>
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!