Passing parameters to *.bat file

 

Hi,

I did not see any example related to how to pass parameters to a .bat file. With the following code:

ShellExecuteW(0,"open","start.bat","123","",1);

I get the following error:

Access violation read to 0x0000007B in 'shell32.dll'

However, the following works when I do not pass any parameters:

ShellExecuteW(0,"open","start.bat","","",1);

Thanks in Advance!

 

I solved this. This was my mistake. For the benefit for other I am posting it here.

I was using an incorrect declaration as follows:

#import "shell32.dll"
  int ShellExecuteW(int hWnd,int lpVerb,string lpFile,int lpParameters,int lpDirectory,int nCmdShow);
#import

The correct one is:

#import "shell32.dll"
  int ShellExecuteW(int hwnd,string Operation,string File,string Parameters,string Directory,int ShowCmd);
#import