how to redirect c# streamwriter output

Microsoft Excel 2003 (full product)
January 20, 2011 at 08:55:38
Specs: windows server standard without hyperv
I have a c# program that writes to a log using streamwriter. The log is specified in the program as xlog.txt with no path and I can't change that.

The program is run from a dos scheduled batch. In windows server 2000, the xlog.txt output goes into the folder where the batch resides, m:\batchfiles

I want to run this program on a windows server standard without hyper v. On that computer the
xlog.txt output goes into c:\windows\syswow64.

How can I direct the output on the new system to m:\batchfiles instead of syswow64?

I tried ">> m:\batchfiles\xlog.txt" after the program and its parameters in the batch file. The log is emtpy.

I tried cd:\m\batchfiles just before the execution of the program in the batch, but the log was still in syswow64.

Any ideas? Please help.

See More: how to redirect c# streamwriter output

Report •

January 20, 2011 at 12:37:50

cd M:\batchfiles

Happy is ONE who says I am an OttoMAN.

Report •

January 22, 2011 at 14:09:53
Thanks, I made it work with the following at the start of the batch file.

cd m:\batchfiles

Report •
Related Solutions

Ask Question