| 
 | 
 
 樓主 |
發表於 16-8-17 21:55
|
顯示全部樓層
 
 
 
 
我找到解法了 
 
https://msdn.microsoft.com/en-us ... -windows-powershell 
 
把ShellExecute 的第3個參數設成 %SystemRoot%\SysWOW64\WindowsPowerShell\v1.0 就好了,注意一下,%SystemRoot% 不會自動取代,要寫死,不然就是 
- //這是x64 windows
 
 - EnableScript("JScript");
 
 - <%
 
 -   WshShell = new ActiveXObject( "WScript.Shell");
 
 -   wshEnv = WshShell.Environment("process");
 
 -   AFL("AFL") = wshEnv("AFL");
 
 -   AFL("SystemRoot") = wshEnv("SystemRoot");
 
 - %>
 
 - function telegram_ps_x64(msg)//中文 msg ok
 
 - {
 
 -         fullpath=AFL+"/utility/telegram.ps1";
 
 -         ShellExecute("powershell","-file "+fullpath+" ""+msg+""", "",0);
 
 - }
 
  
- function telegram_ps_x86(msg)
 
 - {
 
 -         pspath=SystemRoot+"/SysWOW64/WindowsPowerShell/v1.0/";
 
 -         _TRACE(pspath);
 
 -         fullpath=AFL+"/utility/telegram.ps1";
 
 -         ShellExecute("powershell","-file "+fullpath+" ""+msg+""", pspath, 0);
 
 - }
 
  複製代碼 要用 powershell 只能分2個版本了 
 
 
 |   
 
評分
- 
查看全部評分
 
 
 
 
 
 |