R raulavi May 21, 2008 #1 vs 2008 c# How to set my computer's date to +7 days from today's date...? TIA
P parez May 21, 2008 #2 vs 2008 c# How to set my computer's date to +7 days from today's date...? TIA Click to expand... you can run cmd.exe and execute date command using Process class.
vs 2008 c# How to set my computer's date to +7 days from today's date...? TIA Click to expand... you can run cmd.exe and execute date command using Process class.
R raulavi May 21, 2008 #3 how would you do it in c# ? parez said: you can run cmd.exe and execute date command using Process class. Click to expand...
how would you do it in c# ? parez said: you can run cmd.exe and execute date command using Process class. Click to expand...
P parez May 21, 2008 #4 how would you do it in c# ? Click to expand... the following worked for me.. ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe"); startInfo.UseShellExecute = false; startInfo.RedirectStandardInput = true; startInfo.RedirectStandardOutput = true; Process process = Process.Start(startInfo); string command = String.Format("date\r\n{0}\r\n", DateTime.Now.AddDays(7).ToString("MM-dd-yy")); StreamWriter commandWriter = process.StandardInput; commandWriter.WriteLine(command); commandWriter.Flush(); commandWriter.Close(); process.Close();
how would you do it in c# ? Click to expand... the following worked for me.. ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe"); startInfo.UseShellExecute = false; startInfo.RedirectStandardInput = true; startInfo.RedirectStandardOutput = true; Process process = Process.Start(startInfo); string command = String.Format("date\r\n{0}\r\n", DateTime.Now.AddDays(7).ToString("MM-dd-yy")); StreamWriter commandWriter = process.StandardInput; commandWriter.WriteLine(command); commandWriter.Flush(); commandWriter.Close(); process.Close();
R raulavi May 21, 2008 #5 thank you...I will give it a try. parez said: the following worked for me.. ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe"); startInfo.UseShellExecute = false; startInfo.RedirectStandardInput = true; startInfo.RedirectStandardOutput = true; Process process = Process.Start(startInfo); string command = String.Format("date\r\n{0}\r\n", DateTime.Now.AddDays(7).ToString("MM-dd-yy")); StreamWriter commandWriter = process.StandardInput; commandWriter.WriteLine(command); commandWriter.Flush(); commandWriter.Close(); process.Close(); Click to expand...
thank you...I will give it a try. parez said: the following worked for me.. ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe"); startInfo.UseShellExecute = false; startInfo.RedirectStandardInput = true; startInfo.RedirectStandardOutput = true; Process process = Process.Start(startInfo); string command = String.Format("date\r\n{0}\r\n", DateTime.Now.AddDays(7).ToString("MM-dd-yy")); StreamWriter commandWriter = process.StandardInput; commandWriter.WriteLine(command); commandWriter.Flush(); commandWriter.Close(); process.Close(); Click to expand...