使用 .bat 文件檢查文件夾是否存在 [關閉] - Checking if a folder exists using a .bat file [closed]

問題:

Closed. 關閉。 This question does not meet Stack Overflow guidelines . 此問題不符合Stack Overflow 準則 It is not currently accepting answers. 它目前不接受答案。

Want to improve this question?想改善這個問題嗎? Update the question so it's on-topic for Stack Overflow.更新問題,使其成爲 Stack Overflow的主題

Closed 7 years ago . 7年前關閉。

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章