.NET Application and I want do execute a exe.
To this exe:
This exe file is a program to show licensed users.
I test it on my development vm with visual studio 2010 and it works but if i deploy it on the iis7 on my webserver it doens't work. The error is :
ERROR: Cannot create qrun.inf file
What is the problem? Why can't the application create the file?
Here is my code:
Web.Config
:
...
<setting name="LSDYNA_CMD" serializeAs="String">
<value>~\\exe\\lstc_qrun.exe -s lwserv-lic -R</value>
</setting>
...
The exe is in my exe folder
Here I get the value:
string cmd = Properties.Settings.Default.LSDYNA_CMD;
cmd = Server.MapPath(cmd);
string output = ExecuteCommand(cmd);
...
Here is the ExecuteCommand(..)
method
public static string ExecuteCommand(string command)
{
int exitCode;
ProcessStartInfo processInfo;
Process process;
try
{
processInfo = new ProcessStartInfo("cmd.exe", "/c " + command);
processInfo.CreateNoWindow = true;
processInfo.UseShellExecute = false;
processInfo.RedirectStandardError = true;
processInfo.RedirectStandardOutput = true;
using (process = Process.Start(processInfo))
{
string output = process.StandardOutput.ReadToEnd();
exitCode = process.ExitCode;
return output;
}
}
catch (Exception ex)
{
return "error: " + ex.Message;
}
}
I try it on the web server directly and I get the list (O.o) I opened a cmd and make the command inside this.
I need help I don't know how I can do this :(