Call dll which is in folder other than system32

132 Views Asked by At

I want to call my dll through a shortcut, but I need to identify the current directory the dll is in.

At the moment I can only call it this way: C:\Windows\System32\rundll32.exe C:\Users\Public\BUS.dll, print

And I would like to call her that: C:\Windows\System32\rundll32.exe BUS.dll, print

I need a command that returns the current directory and calls the dll

1

There are 1 best solutions below

0
On BEST ANSWER

Assuming that your current directory is the one where bus.dll resides, you can modify the command as follows:

C:\Windows\System32\rundll32.exe %cd%\BUS.dll

%cd% is the Windows cmd variable for the current directory (Reference).