您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

windowselevate.hta 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <html><HTA:APPLICATION ID="windowselevate" icon="#"/>
  2. <script language="vbscript">
  3. document.title = "elxr control panel"
  4. self.ResizeTo 200,600
  5. Sub Window_Onload
  6. self.MoveTo (screen.availWidth - (document.body.clientWidth + 40)),10
  7. End Sub
  8. Set objShell = CreateObject("WScript.Shell")
  9. Set objENV = objShell.Environment("Process")
  10. dim NODE_ENV
  11. NODE_ENV = objENV("NODE_ENV")
  12. </script>
  13. <script language="javascript">
  14. // alert(NODE_ENV);
  15. //WINDOWSTATE="minimize" SHOWINTASKBAR="no" SYSMENU="no" CAPTION="no"
  16. // alert(windowselevate.commandLine)
  17. var args = windowselevate.commandLine.split('"').slice(3);
  18. // alert(args)
  19. var processedArgs = { _ : [] }
  20. for(var item in args){
  21. // alert(args[item].charAt(0))
  22. args[item] ? args[item].charAt(0) === '-' ? processedArgs[args[item].slice(2)] = args[item].split('=')[1] || true : processedArgs._.push(args[item]) : null
  23. }
  24. // args = args.forEach(function(item){ })
  25. // alert('processedArgs._ : ' + processedArgs._);
  26. // alert(processedArgs.runas);
  27. var namedArgs = [];
  28. // Object.keys(processedArgs).forEach( function(v){ v!='_' ? namedArgs.push('--'+v+'='+processedArgs[v]) : null; })
  29. var cargs = (processedArgs.debug ? '--inspect-brk' : '') + ' elxr ' + processedArgs._.join(' ') + ' ' + namedArgs.join(' ') + ' ' + ' --runas=true';
  30. var shell = new ActiveXObject('shell.application');
  31. shell.ShellExecute('node', cargs, '', 'runas', 1);
  32. var fso = new ActiveXObject('Scripting.FileSystemObject');
  33. window.onload = function() {
  34. document.body.style.backgroundColor = 'black';
  35. document.body.style.fontFamily = 'arial';
  36. var log = document.createElement('div');
  37. function l(msg){ log.innerHTML+= msg; };
  38. log.style.color = 'blue';
  39. log.id = 'log';
  40. document.body.appendChild(log);
  41. log.innerHTML='Please Wait';
  42. l('<Br/>Current config : ')
  43. l('<Br/>NODE_ENV = ' + NODE_ENV)
  44. l('<Br/>cmd = ' + processedArgs._[0])
  45. processedArgs._[1] === 'use' ? l('<Br/>using = ' + processedArgs._[2]) : null;
  46. l('<Br/><Br/>')
  47. var timer = function(){
  48. l('.');
  49. if(fso.FileExists("run.done")) close();
  50. else window.setTimeout(timer, 1000);
  51. };
  52. window.setTimeout(timer, 3000);
  53. };
  54. </script>
  55. </html>