Passing parameters to *.bat file



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


I get the following error:

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

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


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);

The correct one is:

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