Getting returnValue 9 (path not found) when I'm trying this, what am I missing? I'm trying to run a .bat file from a button click and the code bellow gives me no exception but it looks like the path can't be found..
try
    {
        ManagementClass management = new ManagementClass("Win32_Process");
        ManagementBaseObject inParams = management.GetMethodParameters("Create");
        inParams["CommandLine"] = "test.bat";
        inParams["CurrentDirectory"] = @"C:\test\"; //this is where test.bat is
        var output = management.InvokeMethod("Create", inParams, null);
        lblStatusResponse.Text = "" + output["returnValue"];
    }
    catch (Exception ex)
    {
        lblStatusResponse.Text = ex.ToString();
    }
 
    