| View previous topic :: View next topic |
| Author |
Message |
Seffyroff Newbie

Joined: 08 Apr 2002 Posts: 15
|
Posted: Tue Apr 16, 2002 11:05 am Post subject: Setting current directory for run operations |
|
|
I'm trying to run an external cmdline program, pipe it's output to a text file, then display that in a list window. There's one hitch. The program performs it's operation only if you are in the directory with the files you wish to perform the operation on.
this is what i'm currently doing:
| Code: |
RUN %B\targs.exe, %A\resource\ps2\levels\%K\textures\*.tga -32 >c:\targs-out.txt, WAIT
|
Which makes targs.exe crash because it won't accept a different directory path to the files for processing.
I've also tried this:
| Code: |
SHELL open, %B\targs.exe, *.tga -32 >c:\targs-out.txt, %A\resource\ps2\levels\%K\textures\, WAIT
|
Which makes targs.exe work, but doesn't pipe it's output to file for some reason.
Any ideas how i can get around the bug in my targs.exe?
I thought about using a batch file, but would rather not if possible  |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Apr 16, 2002 11:34 am Post subject: |
|
|
How about:
| Code: | DIRECTORY CHANGE, %A\resource\ps2\levels\%K\textures\
RUN %B\targs.exe, *.tga -32 >c:\targs-out.txt, WAIT |
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Seffyroff Newbie

Joined: 08 Apr 2002 Posts: 15
|
Posted: Tue Apr 16, 2002 11:36 am Post subject: |
|
|
Doh! that'll do it! nice one, thanks!
BTW, any ideas why i couldn't pipe to a text file from SHELL OPEN? |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1752 Location: Space and Time
|
Posted: Tue Apr 16, 2002 12:07 pm Post subject: |
|
|
It will not work that way. You need to use
the Run command /c MyProg.exe >log.txt
or on win2k cmd /c MyProg.exe >log.txt
It would be nice to do it without command/cmd
but...  _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Apr 16, 2002 12:10 pm Post subject: |
|
|
I think that it is a question of the fact that the redirect part of the command line is not actually
a parameter for your DOS program but rather a way of telling DOS to redirect the program's output
to a file instead of the monitor.
You may try this also:
| Code: | | RUN COMMAND /C %B\targs.exe %A\resource\ps2\levels\%K\textures\*.tga -32 > c:\targs-out.txt, WAIT |
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Tue Apr 16, 2002 1:10 pm Post subject: |
|
|
You should use COMMAND.COM even on Windows 2000 rather than CMD.EXE, so that it'll work on either platform. I think it may be possible to pipe the output even with the SHELL command. I just tried and it works just fine like this:
| Code: |
directory change,C:\
shell open,command.com,/C dir > test.txt
|
Tommy |
|
| Back to top |
|
 |
|