You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

windowselevate.hta 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <html><HTA:APPLICATION ID="windowselevate" icon="#"/>
  2. <script>
  3. //WINDOWSTATE="minimize" SHOWINTASKBAR="no" SYSMENU="no" CAPTION="no"
  4. // alert(windowselevate.commandLine)
  5. var args = windowselevate.commandLine.split('"').slice(3);
  6. // alert(args)
  7. var processedargs = { _ : [] }
  8. for(var item in args){
  9. // alert(args[item].charAt(0))
  10. args[item] ? args[item].charAt(0) === '-' ? processedargs[args[item].slice(2)] = args[item].split('=')[1] || true : processedargs._.push(args[item]) : null
  11. }
  12. // args = args.forEach(function(item){ })
  13. // alert('processedargs._ : ' + processedargs._);
  14. // alert(processedargs.runas);
  15. var shell = new ActiveXObject('shell.application');
  16. shell.ShellExecute('node', 'elxr ' + processedargs._.join(' ') + ' --runas=true', '', 'runas', 1);
  17. var fso = new ActiveXObject('Scripting.FileSystemObject');
  18. window.onload = function() {
  19. document.body.style.backgroundColor = 'black';
  20. document.body.style.fontFamily = 'arial';
  21. var log = document.createElement('div');
  22. function l(msg){ log.innerHTML+= msg; };
  23. log.style.color = 'blue';
  24. log.id = 'log';
  25. document.body.appendChild(log);
  26. log.innerHTML='Please Wait ';
  27. var timer = function(){
  28. l('.');
  29. if(fso.FileExists("run.done")) close();
  30. else window.setTimeout(timer, 1000);
  31. };
  32. window.setTimeout(timer, 3000);
  33. };
  34. </script>
  35. </html>