I have a .vbs file that uses the WScript.exe to map a drive to the network with the correct userid and password. Then will login to sqlplus and execute an Oracle command which outputs a text file to the mapped drive. If I double click the .vbs file, everything works fine. Now I need to have a webmethod do the same behavior as double clicking the .vbs file.
I'm using the System.Diagnosics namespace to use the Process class. I will get an error of "Logon failure: unknown user name or bad password".
Is it because the password gets encrypted? I am using VS2005, in IIS annonymous access is allowed on the virtual directory.
I have been making changes at this for 5 days and would appreciate any understanding. I move from one error to another.
Process process = new Process();
process.StartInfo.WorkingDirectory = @"D:\Projects\Pub\WebServices\MoHuntEdWebSvc\SCRIPTFILES";
process.StartInfo.FileName = @"D:\Projects\Pub\WebServices\MoHuntEdWebSvc\SCRIPTFILES\CreateFTPStudentFile.vbs";
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = false;
process.StartInfo.Domain = "mydomainname";
process.StartInfo.UserName = "myuserid";
_password = "mypassword";
process.StartInfo.Password = new System.Security.SecureString();
foreach (char c in _password)