Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: redirect output redirection /c command.com Pipe > data to file
You can't use a Run command like:
Run("mem.exe", "> mem.txt")
Windows limitation. Instead, use:
Run(Environment("COMSPEC"), "/c mem >mem.txt")Note:
You can get a list of the inventory of a hard drive and send it to a text file by using the following line:
RunWait(Environment("COMSPEC"),"/c dir c:\ /s > c:\hd.txt")
Hd.txt is the file the info is being sent to.
Error 3068: function syntax, illegal delimiter found.I have no control over the < required for this .EXE. as follows
"ppadmtool.exe" < enable.txt
DirChange("C:\Desired Start-in Directory") cmd=Environment("COMSPEC") RunWait(cmd,"/c ppadmtool.exe <enable.txt")Note. No space between < and enable.txt
RunWait("ANYCMD.BAT", "net use y: > c:\test.txt")where ANYCMD.BAT contains:
%1 %2 %3 %4 %5 %6 %7 %8 %9I have noticed that the redirection character ('>') seems to be the problem here... On WinNT 3.51 the above does not work at all, and on Win95 ANYCMD.BAT only receives the 1st 3 parameters (ie. net use y:) and drops the rest. Any ideas???
Two solutions. Take your choice:
OR
%2 %3 %4 %5 %6 %7 %8 %9 > %1
You might need to change your ANYCMD.BAT to something like the following:
@echo off echo %1 %2 %3 %4 %5 %6 %7 %8 %9|find "}" >nul if errorlevel 1 goto NoRedir :IsRedir If [%1]==[}] Exit :: impossible If [%2]==[}] Goto Do2 If [%3]==[}] Goto Do3 If [%4]==[}] Goto Do4 If [%5]==[}] Goto Do5 If [%6]==[}] Goto Do6 If [%7]==[}] Goto Do7 If [%8]==[}] Goto Do8 If [%9]==[}] Exit :: impossible Exit :: should not happen :Do2 %1 > %3 Exit :Do3 %1 %2> %4 Exit :Do4 %1 %2 %3> %5 Exit :Do5 %1 %2 %3 %4> %6 Exit :Do6 %1 %2 %3 %4 %5> %7 Exit :Do7 %1 %2 %3 %4 %5 %6> %8 Exit :Do8 %1 %2 %3 %4 %5 %6 %7> %9 Exit :NoRedir %1 %2 %3 %4 %5 %6 %7 %8 %9 ExitI've given this initial tests and I believe it should work either as is or with minimal tweaking. One thing you MUST do is substitute "}" for ">" when you call the batch file, and the batch file changes it back to ">".
Also, while in Dos you do not need spaces before or after the ">", you must treat "}" as a separate word for this batch file to work.
eg:
RunWait("ANYCMD.BAT","one two three } five")
Article ID: W12898
Filename: Slash C and Redirection Symbol Not Working.txt
File Created: 2013:02:12:09:56:08
Last Updated: 2013:02:12:09:56:08