private void send_command(Quota q) { string windir = Environment.GetEnvironmentVariable("WINDIR"); // System.Diagnostics.Process.Start(@"\Sysnative\dirquota.exe"); //System.Diagnostics.Process.Start(@"c:\windows\system32\dirquota.exe"); System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.FileName = windir+"\\Sysnative\\dirquota.exe"; p.StartInfo.Arguments = "quota add /path:\""+q.newPath+"\" /SourceTemplate:\""+q.template.Replace(getParameter(parameter.templatematch.ToString()),"").Trim()+"\" /Remote:"+server.Text+""; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.CreateNoWindow = true; string sOutput; p.Start(); StreamReader reader = p.StandardOutput; q.pushResult = reader.ReadToEnd(); p.WaitForExit(); q.pushed = p.ExitCode != 0 ? false : true; //MessageBox.Show(p.ExitCode.ToString()); p.Close(); //MessageBox.Show(sOutput); //dirquota quota add /path:"e:\Gruppen\PSK-Z Scherenarm 9mm" /SourceTemplate:"SIAU 02 GB-Grenze Gruppen" /Remote:FSHK1-32 }
private void pushData(ArrayList head, ArrayList row) { Quota q = new Quota(); q.limit = row[head.IndexOf(getParameter(parameter.limit.ToString()))].ToString(); q.path = row[head.IndexOf(getParameter(parameter.path.ToString()))].ToString(); q.template = row[head.IndexOf(getParameter(parameter.template.ToString()))].ToString(); quotas.Add(q); }