배치 파일에서 아래 작업을 수행하려고합니다. 다음은 배치 스크립트 - 배치 파일 아래의 오류는 어디에 있습니까?
배치 파일 (TEST.BAT)입니다 :
- Check if a folder exists
- If not, create the folder.
- If the folder has created then provide Read permission to Everyone
- Else show error that the folder has not created.
set FolderPath="%TEMP%\Data"
IF NOT EXIST %FolderPath% (MKDIR %FolderPath%)
IF EXIST %FolderPath% (icacls %FolderPath% /grant "Everyone":(OI)(CI)R)
ELSE (
ECHO ERROR: The folder %FolderPath% can not be found
GOTO Finish
)
:Finish
그러나 cmd를에서이 TEST.BAT 파일을 실행하는 동안, 나는 오류가 아래에 무엇입니까 :
IF NOT EXIST "C:\Users\Test\AppData\Local\Temp\Data" (MKDIR "C:\Users\Test\AppData\Local\Temp\Data")
(CI)R) was unexpected at this time.
IF EXIST "C:\Users\Test\AppData\Local\Temp\Data" (
icacls "C:\Users\Test\AppData\Local\Temp\Data" /grant "Everyone":(OI)(CI)R)
I 폴더가 생성되었지만 권한이 설정되지 않았 음을 알 수 있습니다. 왜이 오류가 표시되었는지 알려주실 수 있습니까? 감사 !