0

According to this answer, I would like to make this C# method call, but from the command line:

InternetSetOption(IntPtr.Zero, 39, IntPtr.Zero, 0);

My attempt (from CMD):

rundll32.exe,InternetSetOption(0,39,0,0)

Unfortunately, this leads to an error (translated: Problem while starting: wrong parameter):

enter image description here

How can I make this DLL function call? What is the CMD equivalent of the C# IntPtr.Zero?

Community
  • 1
  • 1
  • There is no IntPtr.Zero from the command line. Is rundll32.exe written by you? Alternatively run from PowerShell instead of CMD. – weismat Dec 12 '14 at 11:12
  • rundll32.exe is a standard application which gives you the opportunity to run functions from DLLs. Not written by me ;). How would it work from PowerShell? –  Dec 12 '14 at 11:31
  • 1
    rundll32.exe works only if the DLL implements a specific interface. InternetSetOption does not implement this interface. You would need to write a script - have you looked at this? https://chentiangemalc.wordpress.com/2012/08/24/command-line-proxy-tool-with-c-source/ – weismat Dec 12 '14 at 11:38
  • Thanks! Not a solution, but a good enough workaround. Served my purposes. –  Dec 12 '14 at 12:32

0 Answers0