Saturday, March 26, 2011

Windows Batch files

http://blogs.msdn.com/b/oldnewthing/archive/2005/01/28/362565.aspx

Good article.

Summary

%~dp0 = directory current resource is in. Useful for loading dependencies relative to batch file.

%CD% = current working directory. (Possible different from %~dp0)

e.g.

dir¬

-bin

-lib

If batch file is in bin and includes artifacts in lib, it needs to be able to access them regardless of where cwd is


No comments: