I have occasionally stumbled upon this forum, there is lots of brilliance here. I am not very skillful with batch, but I have some coding experience in other languages.
I have a very basic question today - it's about best practice, professionalism, practicality.
Here is a snippet of code from my script, this section of code checks for some required .dll files that an .exe will need. These checks occur before attempting to run the .exe, because if they're not detected, you get a nasty "loud" popup message outside of cmd.
Code: Select all
IF EXIST libiconv2.dll (
set 3_DEP=y
echo libiconv2.dll exists
) else (
set error=6
goto errorexit
)
IF EXIST libintl3.dll (
set 4_DEP=y
echo libintl3.dll exists
) else (
set error=7
goto errorexit
)
IF EXIST libcharset1.dll (
set 5_DEP=y
echo libcharset1 exists
) else (
set 5_DEP=n
echo optional dependency libcharset1.dll missing
Code: Select all
IF EXIST libiconv2.dll (
set 3_DEP=y
echo libiconv2.dll exists
IF EXIST libintl3.dll (
set 4_DEP=y
echo libintl3.dll exists
IF EXIST libcharset1.dll (
set 5_DEP=y
echo libcharset1 exists
) else (
set 5_DEP=n
echo optional dependency libcharset1.dll missing
) else (
set error=7
goto errorexit
) else (
set error=6
goto errorexit
)