I have a batch file (actually any simple script for Win7 will do, but it already is a cmd file and I would like to keep it that way) that I would like to run only if the directory it is run from has a specific name.
In my case, it creates an "externals" folder and integrates with SVN, but I would like to stop running if the current directory is not named "trunk". There is a warning message to only start it from the "trunk" folder of a new project... but you know how people are.
Through a lot of googling I found that the current path is %cd% and I know how to check a string for equality. I also found a hack to check if a string contains something. But what I would like to know is if my string ends in "\trunk". Any ideas or pointers?