我想在批處理文件中做下面的事情。批處理腳本 - 下面批處理文件中的錯誤在哪裏?
- 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.
下面是批處理文件(test.bat的):
但是在執行從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)
我可以看到該文件夾已創建,但未設置權限。你能告訴我爲什麼會出現這個錯誤嗎?謝謝 !