

Reading of files in a Batch Script is done via using the FOR loop command to go through each line which is defined in the file that needs to be read. The original name of the 'cat' command is. Here are some examples of common commands: cat: Display content in a file or combine two files together. In a script, these commands are executed in series automatically, much like a C or Python program. "4 > i" instead of "i < 4"), we were reversing the condition incorrectly, leading to a loop bound that was off by 1.A shell script is a file containing one or more commands that you would type on the command line. Paul Berry: 1-4 / +4: When analyzing a loop where the loop condition is expressed in the non-standard order (e.g. It works fine for deleting everything except doc2.txt, but I need to keep one other file as well, lets call it Commit message ()Author Files Lines : glsl: Fix loop bounds detection. Here is the part of the script I am having trouble with.

I have a batch file that I'm trying to write to delete everything but two specific files in a directory. Execute the batch file by typing it's name and pressing enter, e.g: somename.

Press the windows key + r (this opens the "run" window) Type: cmd into the text input and press enter (or click ok) Change to the directory that contains the batch file, e.g: cd c:\scripts\foo.
