Hi,
I have created one website with the following code
/* Following code will just access - open 100.20.20.20 Ip with specific credential and allow to access file --- START */
using (System.Diagnostics.Process proc = new System.Diagnostics.Process())
{
proc.StartInfo.FileName = "cmd";
proc.StartInfo.Arguments = @"/c net use \\100.20.20.20\d$ /user:testuser testpwd";
proc.StartInfo.UseShellExecute = false;
proc.Start();
}
/* -END */
/* Following code will try to run exe from the given path */
System.Diagnostics.ProcessStartInfo procStartInfo = new System.Diagnostics.ProcessStartInfo();
procStartInfo.RedirectStandardOutput = true;
procStartInfo.UseShellExecute = false;
procStartInfo.FileName = "notepad";
procStartInfo.Arguments = @"\\100.20.20.20\d$\test\test.txt";
procStartInfo.CreateNoWindow = true;
procStartInfo.Verb = "runas";
using (System.Diagnostics.Process proc = new System.Diagnostics.Process())
{
proc.StartInfo = procStartInfo;
proc.Start();
}
When I run above code from visual studion 2010 - asp.net , it is running fine , It's opening notepad - test.txt properly from the given IP address.
But when Same application i host on IIS 7.0 then no result , no error , do not know what's happening behind the scene..
Tried with the following alternate solution But no luck
1) Given Network Service All rights to the default app pool on IIS 7
2) Given full rights to the Virtual Directory for network Service.
3) Given full rights to the folder which contain this test folder.
Please help me if anyone know
Thanks in Advance...