3

I have been attempting to replicate the function subst.exe (windows app for mapping drives) using rundll32.

I know that DefineDOSDevice is used and I know what parameters to pass but I just can`t get it to work.

Lets just say I want C:\Program Files mapped as Z:

rundll32.exe kernel32.dll, DefineDosDeviceA * * *

I have tried passing all the paremeters in what I think is the correct form with no success.

If anyone could provide me with working syntax for mapping program files to Z: using rundll32 I would be very happy.

Thanks in advance.

Alex K.
  • 171,639
  • 30
  • 264
  • 288

1 Answers1

3

Rundll32 is not a generic "run an exported function" utility, it requires the target call to be prototyped in a specific way (E.g. to receive its command arguments as a string).

As DefineDOSDevice does not adhere to this requirement it cannot be called as you intend.

Alex K.
  • 171,639
  • 30
  • 264
  • 288