Single line DOS commands and echoing formatted output
Posted: 17 Oct 2015 09:34
I have a requirement for a project I'm working on at my job that requires some serious DOS programming skills that I am lacking and was hoping someone would be able to come up with a solution.
#1 A single DOS command line that can determine if a directory exists and echo [DIRECTORY_EXISTS=true] or [DIRECTORY_EXISTS=false]
#2 A single DOS command line that can return a file count from a path and echo [FILECOUNT=X] where X is the number of files in the path provided.
I have found examples of commands that will accomplish both of these requirements but I can't get them to output in the format that is required by the project. Any help would be greatly appreciated.
#1 A single DOS command line that can determine if a directory exists and echo [DIRECTORY_EXISTS=true] or [DIRECTORY_EXISTS=false]
#2 A single DOS command line that can return a file count from a path and echo [FILECOUNT=X] where X is the number of files in the path provided.
I have found examples of commands that will accomplish both of these requirements but I can't get them to output in the format that is required by the project. Any help would be greatly appreciated.