2014-03-27 4 views
0

Windows 8 RecoveryDrive 프로그램을 열 수있는 vbscript로 .hta 응용 프로그램을 만들려고합니다. 내가 갖고있는 스크립트는 다음과 같습니다 :VBScript로 Windows 8/8.1을 엽니 다. RecoveryDrive.exe

Sub Windows8Recovery 
'// Open the Windows 8/8.1 default recovery program 
Set oShell = CreateObject("Wscript.Shell") 
oShell.Run "c:\windows\system32\recoverydrive.exe" 
End Sub 

나는 이것을 실행할 때마다 오류 메시지가 나타납니다 : "시스템이 지정된 파일을 찾을 수 없습니다."

도움말 !!!

+0

명령 프롬프트에서 파일 경로를 테스트 한 결과 예상대로 작동합니다. 스크립트를 별도의 .vbs 파일로 테스트했으며 예상대로 작동합니다. .hta 파일에서이 유형의 명령을 실행하는 데 특별한 것이 있습니까? – TK421

답변

0

마지막으로 문제가 발견되었습니다. 나는 이것을 64 비트 OS에서 돌리고있다. Windows File System Redirector와 관련이 있으며 32 비트와 64 비트 응용 프로그램을 처리하는 방법은 http://msdn.microsoft.com/en-us/library/aa384187(VS.85)입니다. PowerShell을 사용하여 해결 방법을 찾을 수 있었습니까? 다음은 작동 코드입니다.

<html> 
    <body> 
     <a href='#' onclick='Windows8Recovery()'>Win 8 Default Recovery</a> 
     <script language="VBScript"> 
      Sub Windows8Recovery 
       Set objShell = CreateObject("Wscript.Shell") 
       strRDPath = objShell.ExpandEnvironmentStrings("%SystemRoot%") & "\sysnative\RecoveryDrive.exe" 
       Set objShellExec = CreateObject("Shell.Application") 
       objShellExec.ShellExecute "powershell.exe", strRDPath, "", "runas", 1    
      End Sub 
     </script> 
    </body> 
</html>