I am trying to write a very simple small batch script to determine whether anybody in a directory Is a valid file and if this happens, command or finish a copy of GOTO even though I know that the directory T: is empty, still it seems that there is a file there. Can this be a hidden or a system file, and how can I ignore these files?
if current t: \ * * Goto STAGE1 goto finish
I had customized a previous batch file which was specially looking for * .txt files but I can not believe that new files are always a special Type so I need a script to look for a file type. Can I use any switches?
dials / ads "t: \ *. *" & Gt; Nool 2 & gt; Neul & amp; Goto stage 1 || Goto finished
If the indicated file is not found in the directive files (I have omitted the subfolders), then this error level will set to 1. Therefore, check.
dir / ad "t: \" & gt; Nul If any error level gateway step 1, other goto finish edited - to control the case of subdirectories, excluding hidden people
2 & gt; Neul & amp; For the first step 1 / d / r "t: \" %% a in ("*") (Dial / ad "%% ~ fa \\" gt; Tap 2> Nool & amp; / Code>
This will start checking the indicated folder and if no file is found, then repeat the previous command for each directory in the recursive list. If any file is found, then go to step 1 if the command Ends and goes to the next line, then the goto will end.
Comments
Post a Comment