at first - yes I read similar topics and no, it is still not working for me :(
I have quite a long command I need to call from cmdline. It containes almost all special characters like ", \, spaces... so I do not know where the mistake is...
public void PartsDatabaseCSVExport()
{
String command;
String exePath = @"C:\Program Files\EPLAN\Platform\2.7.3\Bin\Eplan.exe";
String product = "Electric P8";
String configFile = @"D:\EPLAN\1_MASTER_DATA\Data\Artikl\EPLAN_CZ\csvimportexport - RMT.cfg";
String outputFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
outputFile+="\\EPLAN_Custom\\exportC.csv";
command = $"/k\"{exePath}\" /Variant: \"{product}\" /NoSplash /Frame:0 /Auto /Quiet partslist /TYPE:EXPORTFROMSYSTEM /SQLFILTERPART:1=1 /FORMAT:IXPamImportCSV /CFGFILE: \"{configFile}\" /EXPORTFILE: \"{outputFile}\"";
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "cmd.exe";
startInfo.Arguments = command;
try
{
// Start the process with the info we specified.
// Call WaitForExit and then the using statement will close.
using (Process exeProcess = Process.Start(startInfo))
{
exeProcess.WaitForExit();
}
}
catch
{
// Log error.
}
}
It ignores quates marks around exePath and only get C:\Program....
Thanks for any help...