if you moved your bin and lib directories from
dmd2\windows\bin
dmd2\windows\lib
dmd2\src
to
dmd\bin
dmd\lib
dmd\src
then you have some extra \..\ 's in your sc.ini file. If that's the problem, try removing those so your sc.ini file looks like this:
[Version]
version=7.51 Build 020
[Environment]
LIB="%@P%\..\lib";\dm\lib
DFLAGS="-I%@P%\..\src\phobos" "-I%@P%\..\src\druntime\import"
LINKCMD=%@P%\link.exe
OR you could get a clean installation of dmd2 and change one line in your bat file from
@SET PATH=%PATH%;\D\dmd\bin
to
@SET PATH=%PATH%;\D\dmd2\windows\bin
bye