2017-02-18 1 views
-1

WinRAR.exe을 실행하고 싶습니다. WinRAR의 경로는 $a이라는 변수에 의해 결정됩니다. 내가 echo $a의 값을 볼 수 있습니다변수를 기반으로 명령 실행

$a = "C:\Program Files\WinRAR" 
$a\WinRAR.exe # this line raises an error 

: 그리고 난 다음 코드를 수정하는 방법을 모르는

$a = "C:\Program Files\WinRAR" 
echo $a # "C:\Program Files\WinRAR" is printed 

을 그리고 C:\"Program Files"\WinRAR\WinRAR.exe을 실행하기 시작할 수 있음을 확신 WinRAR과

아무도 왜 $a\WinRAR.exe가 작동하지 않는 이유를 알고 있습니까?

+1

'& "$ a \ WinRAR.exe"' – PetSerAl

답변

1

정말 간단합니다. winrar 호출에 앰퍼샌드를 접두사로 사용해야합니다.

&$a\winrar.exe 
관련 문제