I need to open the file test.mdb. The path must be fullpath built from whatever directory it is located in relative to the C# program exe
I need to pass the Arguments line which in batch would be passed like this /cmd "MyArgument" For the /cmd switch to work the path must include the full path to the installed MSACCESS.EXE
I just can't work out how to pass the full path to MSACCESS>EXE followed by the fullpath to test.mdb followed by the Arguments.
To try to help I'm posting the following batch string which works but I need C#
"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" "C:\Documents and Settings\User\Test Examples Folder\test.mdb" /cmd "MyArgument"
To make clear two important points:
The test.mdb fullpath must be automatically determined by the launching C# exe it will be the C# exes path but with test.mdb.
And the MSACCESS>EXE path must be the full path to the installed version of MSACCESS.EXE if the C# exe program can automatically check which version i.e. Office 10, Office 12 etc and use that this would be excellent.
This is my code so far:
var filePath = @"test.mdb";
Process process = new Process();
process.StartInfo.FileName = filePath;
process.StartInfo.Arguments = "/cmd " + "\"MyArgument\"";
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();