bat file run with C# Process does not have PATH information -


i have code runs command window run batch script outputs file. part works fine, when running batch script not seem proper path information.

filename() function location saving data.

process proc = null; string targetdir = string.format(@filename()); proc = new process(); proc.startinfo.workingdirectory = targetdir; proc.startinfo.filename = "cmd"; proc.startinfo.arguments = string.format("/c " + filename() + "script.bat > " + filename() + "script_output.txt"); proc.startinfo.createnowindow = false; proc.start(); proc.waitforexit(); 

when run batch script out of c#, works fine , can find java.

when run through c#, reports cannot find java, , not in path variable.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -