There is no or separator in the if statements, || comes very close but I will get to that later. If statements can be nested so my suggestion would be to use:
if condition1==true (do command) else if condition2==true do command
& is a command separator
Both commands will be executed independantly and regardless of each others outcomes.
&& is an "and" type operator, if command1 returns an errorlevel of 0 commannd2 will be executed otherwise it will not.
|| is an "or" type separator, if the command1 returns an errorlevel greater than zero command2 will be executed, otherwise it will not.
The trap to watch out for with || and && is that some commands either set unexpected errorlevel or none at all. I know the below would work with else, it is an example of an outcome other than what may be expected, because the command in question doesn't set an errorlevel:
if 11==66 echo ee||echo ii
| is a pipe it redirects the standard output of one command into the standard input of another.
ver|find /i "version"
The for /f loop is the only inbuilt method to read lines, you could try third party utilities like sfk or or the gnu utils for windows. In both cases the tail command seems to be the one of interest.
If the pathname is part of the current directory you can move one direction back with
This can recur for as many directories as there is on the current directory.
If you want the root of the drive then it is also possible to use:
I don't think you can....
Set /a handles all the math, and sometimes that can be a pain. Numbers are limited to the 32bits on 32bit windows and I assume 64bits on 64bit windows. No floating point math is peformed i.e "set /a 10/3 = 3". Logical shifts are on << and >> and any operation containing them must be enclosed in double quotes because the greater and less than symbols are used to redirect input/output. So you statement is:
set /a "1<<2"
You can also set a variable to the output:
set /a var1="1<<2"