해당 공유에서 파일을 사용중인 경우 "net share xyz / DELETE"가 실패합니다


14

NAnt를 사용하여 공유를 연결 해제하려고 시도하지만 다른 곳으로 리디렉션하려고 시도하지만 시도가 실패합니다.

[exec] Starting 'net (SHARE ad3-config /DELETE)' in 'c:\NAntDistributorBuilds\LocalInstallations\ad3config_master_1.0.19.4006'
[exec] Users have open files on ad3-config.  Continuing the operation will force the files closed.
[exec] No valid response was provided.
[exec] 
[exec] Do you want to continue this operation? (Y/N) [N]: 
[exec] c:\NAntDistributorBuilds\LocalInstallations\ad3config_master_1.0.19.4006\install.build(32,6):
[exec] External Program Failed: net (return code was -1)
[exec] Starting 'net (SHARE ad3-config="c:\NAntDistributorBuilds\LocalInstallations\ad3config_master_1.0.19.4006" /UNLIMITED)' in 'c:\NAntDistributorBuilds\LocalInstallations\ad3config_master_1.0.19.4006'
[exec] The name has already been shared.
[exec] 
[exec] More help is available by typing NET HELPMSG 2118.
[exec] 

명령 줄을 통해 '예'응답을 제공하는 방법을 볼 수 없습니다. / Q 스위치는 없습니다. 대상 시스템은 Windows 2003 서버입니다. DOS는 유닉스 'yes'명령과 동등합니까?

명령 줄에서 할 수 있다면 NAnt의 exec 작업에서 할 수 있습니다.


혼란스러운 의식의 흐름에 대해 죄송합니다. : S
— Andrew Matthews 1

당신도 사용 command.com합니까?
— Hello71

실제로 이것은 빌드 및 배포 도구의 일부입니다. NAnt (약간 make)를 사용 하여 net 명령 을 직접 호출하고 있습니다.
— 앤드류 매튜스

답변:



1

당신은 단지 할 수 없습니까 echo Y? cmd를 사용하지 않는다면로 실행하십시오 %COMSPEC% /c echo Y | net....


안녕하세요 Hello71, 안타깝게도 작동하지 않았습니다.
— Andrew Matthews

"응답이 제공되지 않음"과 동일한 오류
— Andrew Matthews
당사 사이트를 사용함과 동시에 당사의 쿠키 정책과 개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.