Help about Windows Batch file.
-
Hi! I'm calling an exe from a Batch file using CALL statement. The exe is not the same folder with batch file. The exe is inside some other folder. The exe has some dependencies(VC++ DLL's). How to include/call those DLL's also inside the CALL statement so that my exe would run without errors? The code that I use is:
PushD .
Cd ..
Call Gen /AssetManager:Disable /DisplayErrors:off /ReturnErrorsCount:off /Log:Enable /Log:Html /Log:Verbose /Window:Normal /CreateObjectHash /RemoveSources:On /CreateResourceHash /GenerateDisplayLists:On /GenerateSceneLists:Off /GeneratePreDrawOT "france_1222\Test.xml" france_1222\%_SDF_% "iPhone"
PopD"Gen" is my exe name.
-
Hi! I'm calling an exe from a Batch file using CALL statement. The exe is not the same folder with batch file. The exe is inside some other folder. The exe has some dependencies(VC++ DLL's). How to include/call those DLL's also inside the CALL statement so that my exe would run without errors? The code that I use is:
PushD .
Cd ..
Call Gen /AssetManager:Disable /DisplayErrors:off /ReturnErrorsCount:off /Log:Enable /Log:Html /Log:Verbose /Window:Normal /CreateObjectHash /RemoveSources:On /CreateResourceHash /GenerateDisplayLists:On /GenerateSceneLists:Off /GeneratePreDrawOT "france_1222\Test.xml" france_1222\%_SDF_% "iPhone"
PopD"Gen" is my exe name.
You don't need the
CALL
command to execute an executable program from within a batch file. TheCALL
command is provided to execute other batch files from within a batch file or call a local subfunction. Each executable file tries itself to resolve DLL dependicies. If your application terminates due to missing DLLs, you must place the DLLs in common directories or modify the DLL search pathes. Common DLL directories are:- The directory from which the application loaded.
- The system directory.
- The Windows directory.
- The directories that are listed in the
PATH
environment variable.
To add directories that are searched by your application you may use the API function
SetDllDirectory()
. To add directories using a batch file, append them to thePATH
environment variable.