Showing posts with label bat. Show all posts
Showing posts with label bat. Show all posts

12.6.15

BAT file to Register a DLL


If you have a number of DLLs that you want to register, then considering creating a BAT script for that.

Create a file with .bat extension, and enter the one line command, like below, for each dll.

regsvr32 "C:\Program Files\DLLNameToRegister.dll"


Its not necessary but advisable to have the entire path of the DLL mentioned in the above command, which will save anyone the trouble of fixing 'dll not found' issues. One of the other ways you can do this is by saving the .bat file in the same dir as the DLL, but this may not be always possible.

Also, you may need Admin rights to register some DLLs, so make sure you run the .bat file with an admin ID.
Once done, you will get a message that says that the registration succeeded.

19.11.14

BAT to launch applications with specific Environment Variables

Often you end up in situations, where after installing some software, your previous ones stop working; or the new ones dont work as they should as previous ones are interfering. One of the reasons for this issue could be the environment variables being set and used by such software. And this always happens when you have QTP [along with java add-in] installed, which causes other java-based software to just not launch/start altogether.
To overcome this issue of same environment variables being used by different programs, we can create a .BAT file to temporarily set and launch/start the applications with those environment variables.

This below code will help launch DBArtisan [database client] by setting up the environment variables required for it, some of which have been hijacked by QTP.
We can write similar stuff for any application we want.

-----------------------------------------------
Set SYBASE=C:\Progra~2\Syb155

Set SYBASE_OCS=OCS-15_0

Set INCLUDE=C:\Progra~2\Syb155\OCS-15_0\include;%INCLUDE%

Set LIB=C:\Progra~2\Syb155\OCS-15_0\lib;%LIB%

Set PATH=C:\Progra~2\Syb155\OCS-15_0\bin;C:\Progra~2\Syb155\OCS-15_0\dll;C:\Progra~2\Syb155\OCS-15_0\lib3p;%PATH%

Set PATH=C:\Progra~2\Syb155\DataAccess\OLEDB\dll;%PATH%

Set PATH=C:\Progra~2\Syb155\DataAccess\ODBC\dll;%PATH%

Set LIB=C:\Progra~2\Syb155\DataAccess\ADONET\dll;%LIB%

Set PATH=C:\Progra~2\Syb155\DataAccess\ADONET\dll;%PATH%


Start C:\Progra~2\Enbarcadero\dbart901_11364_ion.exe

-----------------------------------------------