Saved Bookmarks
| 1. |
Solve : How to check if a Directory already exists...? |
|
Answer» Would the syntax: CD \Program Files it's \ that distinguishs a folder from a file Quote from: Prince_ on December 07, 2008, 05:23:16 AM QuoteUnfortunately, ELSE isn't a command. Quote from: Carbon Dudeoxide on December 07, 2008, 05:26:06 AMCD \Program Files Quote from: Prince_ on December 07, 2008, 05:23:16 AMQuoteUnfortunately, ELSE isn't a command.CD \Program Files Careless Quote from: Prince_ on December 07, 2008, 05:23:16 AM QuoteCD \Program Files So what? You cannot have a file and a folder with the same name in the same folder. so what is your point? if there is a file named alec, then the code snippets below won't work. Code: [Select]CD \Program Files IF not exist ALEC (md alec) ELSE ( {Codeing here} ) ACTUALLY,the best codes would be : Code: [Select]CD \Program Files IF not exist ALEC\ ((if exist alec del alec) & md alec) ELSE ( {Codeing here} )yes, because it's always important to delete possibly vital data in the better INTEREST of a proper batch file.You really cannot get any simpler than: Code: [Select]cd Program Files if not exist ALEC ( md ALEC ) else ( codes here ) Quote actually,the best codes would be : Quote from: BC_Programmer on December 07, 2008, 06:55:02 PM yes, because it's always important to delete possibly vital data in the better interest of a proper batch file. LOL The price of fame! Where did the last 7 years CORPORATE tax records go? |
|