2014-04-11 2 views
0

원격 컴퓨터의 실행 정책을 변경하려고합니다. 명령 다음에 정책은 변경되지만 cmd 프롬프트에는 제어가 전달되지 않습니다. 명령은 내가 사용 :cmd에서 psexec를 통해 powershell 명령을 실행 한 후 cmd 프롬프트로 돌아 가지 않음

C:\amp>psexec \\networkcomputer -u user -p password powershell Set-ExecutionPolicy RemoteSigned 

을 cmd를 창에서이

C:\amp>psexec \\networkcomputer -u user -p password powershell Set-ExecutionPolicy RemoteSigned 

PsExec v2.1 - Execute processes remotely 
Copyright (C) 2001-2013 Mark Russinovich 
Sysinternals - www.sysinternals.com 

을 보여줍니다 그것에서 얻을하는 방법

답변

0
당신은 확인을 요청하는 메시지가 점점 될 수

-Force를 사용 명령으로 char을 전환하고 파이프로 연결

psexec \\networkcomputer -u user -p password "echo . | powershell Set-ExecutionPolicy RemoteSigned -Force" 
+0

I di 그것도 붙어있어. – Kneer

+0

답을 수정했다. – Raf

+0

주는 오류 PsExec가 에코를 시작할 수 없습니다. | powershell Set-ExecutionPolicy RemoteSigned - 네트워크 컴퓨터에서의 공격 : 파일 이름, 디렉터리 이름 또는 볼륨 레이블 구문이 잘못되었습니다. – Kneer