Substrings in bat files
Useful snippet of code for getting substrings in windows batch files:
Code:
SET VARIABLE=%OTHERVARIABLE:~index,length%
Example:
SET FIRSTNAME=%HELENNAME:~0,5%
Source: windows 2000 mailing list.
Useful snippet of code for getting substrings in windows batch files:
Code:
SET VARIABLE=%OTHERVARIABLE:~index,length%
Example:
SET FIRSTNAME=%HELENNAME:~0,5%
Source: windows 2000 mailing list.
Comments
A good thing that someone knew this. I used it to set up a task running every hour, in a sort of easy way.