Advertisement
jcunews

Runhide.js

Jun 2nd, 2024 (edited)
642
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Run given command line as hidden. Non-intrusive. No window flashing.
  2. //Note: hidden as a suggestion to the executed application. Applications always have the final decision on how to show their UI.
  3. //This script is only for use with Windows Script Host.
  4. //Usage e.g.:
  5. //  wscript.exe Runhide.js "d:\my apps\the app.exe" param1 "param 2" etc.
  6. a = [];
  7. e = new Enumerator(WSH.arguments);
  8. while (!e.atEnd()) {
  9.   a.push(/\s/.test(s = e.item(^).replace(/''/g, '"')) ? '"'+s+'"' : s);
  10.   e.moveNext()
  11. }
  12. if (a.length) new ActiveXObject("wscript.shell").run(a.join(" "), 0)
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement