Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how could I execute a dll as a exe using batch

I need to know how I could make a batch file that would execute a dll file as if it was an exe does any one know what I could do I am using windows 7. The file is an exe just with the dll extension.

like image 552
09stephenb Avatar asked Jan 06 '14 13:01

09stephenb


1 Answers

If i understand it, you have a myProgram.exe file renamed as myProgram.dll and want to run that executable.

If this is the case then all you need is to directly invoke the file. To test, from command line, from the same directory where the file is, type myProgram.dll and it will execute. The OS will identify the file as executable an run it.

If you want to execute the program from another directory, and you supply the full path to the executable, it will also work.

BUT if you want to call the executable from another directory without indicating the full path to the executable, using the PATH variable to locate the program, it will not work.

When a program is search over the folders indicated in PATH variable, the content of variable PATHEXT determine the extensions of files to search in PATH folders. And .dll is not in this list.

So, or you indicate the full path to the executable (absolute o relative) or include the .dll extension in the PATHEXT variable before calling your executable.

like image 74
MC ND Avatar answered Sep 28 '22 10:09

MC ND