PDA

View Full Version : output file


pr01n
08-08-2006, 06:36 AM
Hi all !
i'm trying to execute a .exe file with argument.

the argument is "> out.txt" to redirect output to a simple textfile

i've tried both .exe and .bat file (executed manually works fine !)

my code is

result = File.Run("AutoPlay\\pci32\\PCI32.bat", "",_DesktopFolder, SW_SHOWNORMAL, true);

result = File.Run("AutoPlay\\pci32\\PCI32.exe", "-s > out.txt",_DesktopFolder, SW_SHOWNORMAL, true);

it always return an empty out.txt file ! :huh

also tried with Shell.Execute function with same problem...

thx anyway !

bye

bule
08-08-2006, 06:52 AM
Bat files should be .Open, not .Run!

pr01n
08-08-2006, 07:25 AM
Bat files should be .Open, not .Run!

Thaks, but i've changed in

result = File.Open("AutoPlay\\pci32\\PCI32.bat", _DesktopFolder,SW_SHOWNORMAL);

with the same results, an empty out.txt

:huh

bule
08-08-2006, 12:17 PM
Try changing > out.txt into >> out.txt in your bat file.

pr01n
08-08-2006, 01:05 PM
Try changing > out.txt into >> out.txt in your bat file.

great man !
now work fine ! :yes
thx twice !

bule
08-08-2006, 01:32 PM
Great!
Now try this:

File.Run("AutoPlay\\pci32\\PCI32.exe", "-s >> out.txt",_DesktopFolder, SW_SHOWNORMAL, true);