問題:
I would like to be able to check if a certain folder (FolderA) exists and if so, for a message to be displayed and then the batch file to be exited.我希望能夠檢查某個文件夾 (FolderA) 是否存在,如果存在,則顯示一條消息,然後退出批處理文件。
If FolderA does not exist, I would then like to check if another folder (FolderB) exists.如果 FolderA 不存在,我想檢查是否存在另一個文件夾(FolderB)。 If FolderB does not exist, a message should be displayed and the folder should be created, and if FolderB does exist, a message should be displayed saying so.如果 FolderB 不存在,則應顯示一條消息並應創建該文件夾,如果 FolderB 確實存在,則應顯示一條消息說明存在。
Does anybody have any idea on the code I could simply use on notepad to create a batch file to allow me to do this?有沒有人對我可以簡單地在記事本上使用以創建批處理文件以允許我執行此操作的代碼有任何想法?
All of this needs to be done in one .bat
file.所有這些都需要在一個.bat
文件中完成。
解決方案:
參考一: https://en.stackoom.com/question/1QFqr參考二: https://stackoom.com/question/1QFqr