French translation + misc fixes.
[wine/wine-kai.git] / programs / wcmd / wcmdmain.c
blobf440b791f18f1c696f403bde6cf3d0159cc250d2
1 /*
2 * WCMD - Wine-compatible command line interface.
4 * Copyright (C) 1999 - 2001 D A Pickles
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * FIXME:
23 * - Cannot handle parameters in quotes
24 * - Lots of functionality missing from builtins
27 #include "wcmd.h"
29 char *inbuilt[] = {"ATTRIB", "CALL", "CD", "CHDIR", "CLS", "COPY", "CTTY",
30 "DATE", "DEL", "DIR", "ECHO", "ERASE", "FOR", "GOTO",
31 "HELP", "IF", "LABEL", "MD", "MKDIR", "MOVE", "PATH", "PAUSE",
32 "PROMPT", "REM", "REN", "RENAME", "RD", "RMDIR", "SET", "SHIFT",
33 "TIME", "TITLE", "TYPE", "VERIFY", "VER", "VOL", "EXIT" };
35 HINSTANCE hinst;
36 DWORD errorlevel;
37 int echo_mode = 1, verify_mode = 0;
38 char nyi[] = "Not Yet Implemented\n\n";
39 char newline[] = "\n";
40 char version_string[] = "WCMD Version 0.17\n\n";
41 char anykey[] = "Press Return key to continue: ";
42 char quals[MAX_PATH], param1[MAX_PATH], param2[MAX_PATH];
43 BATCH_CONTEXT *context = NULL;
45 /*****************************************************************************
46 * Main entry point. This is a console application so we have a main() not a
47 * winmain().
50 int main (int argc, char *argv[])
52 char string[1024];
53 char* cmd=NULL;
54 DWORD count;
55 HANDLE h;
56 int opt_c, opt_k, opt_q;
58 argv++;
59 opt_c=opt_k=opt_q=0;
60 while (*argv!=NULL)
62 if (lstrcmpi(*argv,"/c")==0) {
63 opt_c=1;
64 argv++;
65 break;
66 } else if (lstrcmpi(*argv,"/q")==0) {
67 opt_q=1;
68 } else if (lstrcmpi(*argv,"/k")==0) {
69 opt_k=1;
70 argv++;
71 break;
72 } else if (lstrcmpi(*argv,"/t")==0 || lstrcmpi(*argv,"/x")==0 ||
73 lstrcmpi(*argv,"/y")==0) {
74 /* Ignored for compatibility with Windows */
75 } else {
76 break;
78 argv++;
81 if (opt_q) {
82 WCMD_echo("OFF");
85 if (opt_c || opt_k) {
86 int len;
87 char** arg;
88 char* p;
90 /* Build the command to execute */
91 len = 0;
92 for (arg = argv; *arg; arg++)
94 int has_space,bcount;
95 char* a;
97 has_space=0;
98 bcount=0;
99 a=*arg;
100 if( !*a ) has_space=1;
101 while (*a!='\0') {
102 if (*a=='\\') {
103 bcount++;
104 } else {
105 if (*a==' ' || *a=='\t') {
106 has_space=1;
107 } else if (*a=='"') {
108 /* doubling of '\' preceeding a '"',
109 * plus escaping of said '"'
111 len+=2*bcount+1;
113 bcount=0;
115 a++;
117 len+=(a-*arg)+1 /* for the separating space */;
118 if (has_space)
119 len+=2; /* for the quotes */
122 cmd = HeapAlloc(GetProcessHeap(), 0, len);
123 if (!cmd)
124 exit(1);
126 p = cmd;
127 for (arg = argv; *arg; arg++)
129 int has_space,has_quote;
130 char* a;
132 /* Check for quotes and spaces in this argument */
133 has_space=has_quote=0;
134 a=*arg;
135 if( !*a ) has_space=1;
136 while (*a!='\0') {
137 if (*a==' ' || *a=='\t') {
138 has_space=1;
139 if (has_quote)
140 break;
141 } else if (*a=='"') {
142 has_quote=1;
143 if (has_space)
144 break;
146 a++;
149 /* Now transfer it to the command line */
150 if (has_space)
151 *p++='"';
152 if (has_quote) {
153 int bcount;
154 char* a;
156 bcount=0;
157 a=*arg;
158 while (*a!='\0') {
159 if (*a=='\\') {
160 *p++=*a;
161 bcount++;
162 } else {
163 if (*a=='"') {
164 int i;
166 /* Double all the '\\' preceeding this '"', plus one */
167 for (i=0;i<=bcount;i++)
168 *p++='\\';
169 *p++='"';
170 } else {
171 *p++=*a;
173 bcount=0;
175 a++;
177 } else {
178 strcpy(p,*arg);
179 p+=strlen(*arg);
181 if (has_space)
182 *p++='"';
183 *p++=' ';
185 if (p > cmd)
186 p--; /* remove last space */
187 *p = '\0';
190 if (opt_c) {
191 /* If we do a "wcmd /c command", we don't want to allocate a new
192 * console since the command returns immediately. Rather, we use
193 * the currently allocated input and output handles. This allows
194 * us to pipe to and read from the command interpreter.
196 if (strchr(cmd,'|') != NULL)
197 WCMD_pipe(cmd);
198 else
199 WCMD_process_command(cmd);
200 HeapFree(GetProcessHeap(), 0, cmd);
201 return 0;
204 SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), ENABLE_LINE_INPUT |
205 ENABLE_ECHO_INPUT | ENABLE_PROCESSED_INPUT);
206 SetConsoleTitle("Wine Command Prompt");
208 if (opt_k) {
209 WCMD_process_command(cmd);
210 HeapFree(GetProcessHeap(), 0, cmd);
214 * If there is an AUTOEXEC.BAT file, try to execute it.
217 GetFullPathName ("\\autoexec.bat", sizeof(string), string, NULL);
218 h = CreateFile (string, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
219 if (h != INVALID_HANDLE_VALUE) {
220 CloseHandle (h);
221 #if 0
222 WCMD_batch_command (string);
223 #endif
227 * Loop forever getting commands and executing them.
230 WCMD_version ();
231 while (TRUE) {
232 WCMD_show_prompt ();
233 ReadFile (GetStdHandle(STD_INPUT_HANDLE), string, sizeof(string), &count, NULL);
234 if (count > 1) {
235 string[count-1] = '\0'; /* ReadFile output is not null-terminated! */
236 if (string[count-2] == '\r') string[count-2] = '\0'; /* Under Windoze we get CRLF! */
237 if (lstrlen (string) != 0) {
238 if (strchr(string,'|') != NULL) {
239 WCMD_pipe (string);
241 else {
242 WCMD_process_command (string);
250 /*****************************************************************************
251 * Process one command. If the command is EXIT this routine does not return.
252 * We will recurse through here executing batch files.
256 void WCMD_process_command (char *command)
258 char *cmd, *p;
259 int status, i, len;
260 DWORD count;
261 HANDLE old_stdin = 0, old_stdout = 0, h;
262 char *whichcmd;
266 * Expand up environment variables.
268 len = ExpandEnvironmentStrings (command, NULL, 0);
269 cmd = HeapAlloc( GetProcessHeap(), 0, len );
270 status = ExpandEnvironmentStrings (command, cmd, len);
271 if (!status) {
272 WCMD_print_error ();
273 HeapFree( GetProcessHeap(), 0, cmd );
274 return;
278 * Changing default drive has to be handled as a special case.
281 if ((cmd[1] == ':') && IsCharAlpha (cmd[0]) && (strlen(cmd) == 2)) {
282 status = SetCurrentDirectory (cmd);
283 if (!status) WCMD_print_error ();
284 HeapFree( GetProcessHeap(), 0, cmd );
285 return;
288 /* Dont issue newline WCMD_output (newline); @JED*/
291 * Redirect stdin and/or stdout if required.
294 if ((p = strchr(cmd,'<')) != NULL) {
295 h = CreateFile (WCMD_parameter (++p, 0, NULL), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
296 FILE_ATTRIBUTE_NORMAL, NULL);
297 if (h == INVALID_HANDLE_VALUE) {
298 WCMD_print_error ();
299 HeapFree( GetProcessHeap(), 0, cmd );
300 return;
302 old_stdin = GetStdHandle (STD_INPUT_HANDLE);
303 SetStdHandle (STD_INPUT_HANDLE, h);
305 if ((p = strchr(cmd,'>')) != NULL) {
306 h = CreateFile (WCMD_parameter (++p, 0, NULL), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
307 FILE_ATTRIBUTE_NORMAL, NULL);
308 if (h == INVALID_HANDLE_VALUE) {
309 WCMD_print_error ();
310 HeapFree( GetProcessHeap(), 0, cmd );
311 return;
313 old_stdout = GetStdHandle (STD_OUTPUT_HANDLE);
314 SetStdHandle (STD_OUTPUT_HANDLE, h);
315 *--p = '\0';
317 if ((p = strchr(cmd,'<')) != NULL) *p = '\0';
320 * Strip leading whitespaces, and a '@' if supplied
322 whichcmd = WCMD_strtrim_leading_spaces(cmd);
323 if (whichcmd[0] == '@') whichcmd++;
326 * Check if the command entered is internal. If it is, pass the rest of the
327 * line down to the command. If not try to run a program.
330 count = 0;
331 while (IsCharAlphaNumeric(whichcmd[count])) {
332 count++;
334 for (i=0; i<=WCMD_EXIT; i++) {
335 if (CompareString (LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT,
336 whichcmd, count, inbuilt[i], -1) == 2) break;
338 p = WCMD_strtrim_leading_spaces (&whichcmd[count]);
339 WCMD_parse (p, quals, param1, param2);
340 switch (i) {
342 case WCMD_ATTRIB:
343 WCMD_setshow_attrib ();
344 break;
345 case WCMD_CALL:
346 WCMD_batch (param1, p, 1);
347 break;
348 case WCMD_CD:
349 case WCMD_CHDIR:
350 WCMD_setshow_default ();
351 break;
352 case WCMD_CLS:
353 WCMD_clear_screen ();
354 break;
355 case WCMD_COPY:
356 WCMD_copy ();
357 break;
358 case WCMD_CTTY:
359 WCMD_change_tty ();
360 break;
361 case WCMD_DATE:
362 WCMD_setshow_date ();
363 break;
364 case WCMD_DEL:
365 case WCMD_ERASE:
366 WCMD_delete (0);
367 break;
368 case WCMD_DIR:
369 WCMD_directory ();
370 break;
371 case WCMD_ECHO:
372 /* Use the unstripped version of the following data - step over the space */
373 /* but only if a parameter follows */
374 if (strlen(&whichcmd[count]) > 0)
375 WCMD_echo(&whichcmd[count+1]);
376 else
377 WCMD_echo(&whichcmd[count]);
378 break;
379 case WCMD_FOR:
380 WCMD_for (p);
381 break;
382 case WCMD_GOTO:
383 WCMD_goto ();
384 break;
385 case WCMD_HELP:
386 WCMD_give_help (p);
387 break;
388 case WCMD_IF:
389 WCMD_if (p);
390 break;
391 case WCMD_LABEL:
392 WCMD_volume (1, p);
393 break;
394 case WCMD_MD:
395 case WCMD_MKDIR:
396 WCMD_create_dir ();
397 break;
398 case WCMD_MOVE:
399 WCMD_move ();
400 break;
401 case WCMD_PATH:
402 WCMD_setshow_path (p);
403 break;
404 case WCMD_PAUSE:
405 WCMD_pause ();
406 break;
407 case WCMD_PROMPT:
408 WCMD_setshow_prompt ();
409 break;
410 case WCMD_REM:
411 break;
412 case WCMD_REN:
413 case WCMD_RENAME:
414 WCMD_rename ();
415 break;
416 case WCMD_RD:
417 case WCMD_RMDIR:
418 WCMD_remove_dir ();
419 break;
420 case WCMD_SET:
421 WCMD_setshow_env (p);
422 break;
423 case WCMD_SHIFT:
424 WCMD_shift ();
425 break;
426 case WCMD_TIME:
427 WCMD_setshow_time ();
428 break;
429 case WCMD_TITLE:
430 if (strlen(&whichcmd[count]) > 0)
431 WCMD_title(&whichcmd[count+1]);
432 break;
433 case WCMD_TYPE:
434 WCMD_type ();
435 break;
436 case WCMD_VER:
437 WCMD_version ();
438 break;
439 case WCMD_VERIFY:
440 WCMD_verify (p);
441 break;
442 case WCMD_VOL:
443 WCMD_volume (0, p);
444 break;
445 case WCMD_EXIT:
446 ExitProcess (0);
447 default:
448 WCMD_run_program (whichcmd);
450 HeapFree( GetProcessHeap(), 0, cmd );
451 if (old_stdin) {
452 CloseHandle (GetStdHandle (STD_INPUT_HANDLE));
453 SetStdHandle (STD_INPUT_HANDLE, old_stdin);
455 if (old_stdout) {
456 CloseHandle (GetStdHandle (STD_OUTPUT_HANDLE));
457 SetStdHandle (STD_OUTPUT_HANDLE, old_stdout);
461 /******************************************************************************
462 * WCMD_run_program
464 * Execute a command line as an external program. If no extension given then
465 * precedence is given to .BAT files. Must allow recursion.
467 * FIXME: Case sensitivity in suffixes!
470 void WCMD_run_program (char *command) {
472 STARTUPINFO st;
473 PROCESS_INFORMATION pe;
474 SHFILEINFO psfi;
475 DWORD console;
476 BOOL status;
477 HANDLE h;
478 HINSTANCE hinst;
479 char filetorun[MAX_PATH];
481 WCMD_parse (command, quals, param1, param2); /* Quick way to get the filename */
482 if (!(*param1) && !(*param2))
483 return;
484 if (strpbrk (param1, "\\:") == NULL) { /* No explicit path given */
485 if ((strchr (param1, '.') == NULL) || (strstr (param1, ".bat") != NULL)) {
486 if (SearchPath (NULL, param1, ".bat", sizeof(filetorun), filetorun, NULL)) {
487 WCMD_batch (filetorun, command, 0);
488 return;
491 if ((strchr (param1, '.') == NULL) || (strstr (param1, ".cmd") != NULL)) {
492 if (SearchPath (NULL, param1, ".cmd", sizeof(filetorun), filetorun, NULL)) {
493 WCMD_batch (filetorun, command, 0);
494 return;
498 else { /* Explicit path given */
499 if ((strstr (param1, ".bat") != NULL) ||
500 (strstr (param1, ".cmd") != NULL)) {
501 WCMD_batch (param1, command, 0);
502 return;
504 if (strchr (param1, '.') == NULL) {
505 strcpy (filetorun, param1);
506 strcat (filetorun, ".bat");
507 h = CreateFile (filetorun, GENERIC_READ, FILE_SHARE_READ,
508 NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
509 if (h != INVALID_HANDLE_VALUE) {
510 CloseHandle (h);
511 WCMD_batch (param1, command, 0);
512 return;
517 /* No batch file found, assume executable */
519 hinst = FindExecutable (param1, NULL, filetorun);
520 if ((int)hinst < 32) {
521 WCMD_print_error ();
522 return;
524 console = SHGetFileInfo (filetorun, 0, &psfi, sizeof(psfi), SHGFI_EXETYPE);
525 ZeroMemory (&st, sizeof(STARTUPINFO));
526 st.cb = sizeof(STARTUPINFO);
527 status = CreateProcess (NULL, command, NULL, NULL, FALSE,
528 0, NULL, NULL, &st, &pe);
529 if (!status) {
530 WCMD_print_error ();
531 return;
533 if (!console) errorlevel = 0;
534 else
536 if (!HIWORD(console)) WaitForSingleObject (pe.hProcess, INFINITE);
537 GetExitCodeProcess (pe.hProcess, &errorlevel);
538 if (errorlevel == STILL_ACTIVE) errorlevel = 0;
542 /******************************************************************************
543 * WCMD_show_prompt
545 * Display the prompt on STDout
549 void WCMD_show_prompt (void) {
551 int status;
552 char out_string[MAX_PATH], curdir[MAX_PATH], prompt_string[MAX_PATH];
553 char *p, *q;
555 status = GetEnvironmentVariable ("PROMPT", prompt_string, sizeof(prompt_string));
556 if ((status == 0) || (status > sizeof(prompt_string))) {
557 lstrcpy (prompt_string, "$P$G");
559 p = prompt_string;
560 q = out_string;
561 *q = '\0';
562 while (*p != '\0') {
563 if (*p != '$') {
564 *q++ = *p++;
565 *q = '\0';
567 else {
568 p++;
569 switch (toupper(*p)) {
570 case '$':
571 *q++ = '$';
572 break;
573 case 'B':
574 *q++ = '|';
575 break;
576 case 'D':
577 GetDateFormat (LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, q, MAX_PATH);
578 while (*q) q++;
579 break;
580 case 'E':
581 *q++ = '\E';
582 break;
583 case 'G':
584 *q++ = '>';
585 break;
586 case 'L':
587 *q++ = '<';
588 break;
589 case 'N':
590 status = GetCurrentDirectory (sizeof(curdir), curdir);
591 if (status) {
592 *q++ = curdir[0];
594 break;
595 case 'P':
596 status = GetCurrentDirectory (sizeof(curdir), curdir);
597 if (status) {
598 lstrcat (q, curdir);
599 while (*q) q++;
601 break;
602 case 'Q':
603 *q++ = '=';
604 break;
605 case 'T':
606 GetTimeFormat (LOCALE_USER_DEFAULT, 0, NULL, NULL, q, MAX_PATH);
607 while (*q) q++;
608 break;
609 case 'V':
610 lstrcat (q, version_string);
611 while (*q) q++;
612 break;
613 case '_':
614 *q++ = '\n';
615 break;
617 p++;
618 *q = '\0';
621 WCMD_output (out_string);
624 /****************************************************************************
625 * WCMD_print_error
627 * Print the message for GetLastError
630 void WCMD_print_error (void) {
631 LPVOID lpMsgBuf;
632 DWORD error_code;
633 int status;
635 error_code = GetLastError ();
636 status = FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
637 NULL, error_code, 0, (LPTSTR) &lpMsgBuf, 0, NULL);
638 if (!status) {
639 WCMD_output ("FIXME: Cannot display message for error %d, status %d\n",
640 error_code, GetLastError());
641 return;
643 WCMD_output (lpMsgBuf);
644 LocalFree ((HLOCAL)lpMsgBuf);
645 WCMD_output (newline);
646 return;
649 /*******************************************************************
650 * WCMD_parse - parse a command into parameters and qualifiers.
652 * On exit, all qualifiers are concatenated into q, the first string
653 * not beginning with "/" is in p1 and the
654 * second in p2. Any subsequent non-qualifier strings are lost.
655 * Parameters in quotes are handled.
658 void WCMD_parse (char *s, char *q, char *p1, char *p2) {
660 int p = 0;
662 *q = *p1 = *p2 = '\0';
663 while (TRUE) {
664 switch (*s) {
665 case '/':
666 *q++ = *s++;
667 while ((*s != '\0') && (*s != ' ') && *s != '/') {
668 *q++ = toupper (*s++);
670 *q = '\0';
671 break;
672 case ' ':
673 s++;
674 break;
675 case '"':
676 s++;
677 while ((*s != '\0') && (*s != '"')) {
678 if (p == 0) *p1++ = *s++;
679 else if (p == 1) *p2++ = *s++;
680 else s++;
682 if (p == 0) *p1 = '\0';
683 if (p == 1) *p2 = '\0';
684 p++;
685 if (*s == '"') s++;
686 break;
687 case '\0':
688 return;
689 default:
690 while ((*s != '\0') && (*s != ' ')) {
691 if (p == 0) *p1++ = *s++;
692 else if (p == 1) *p2++ = *s++;
693 else s++;
695 if (p == 0) *p1 = '\0';
696 if (p == 1) *p2 = '\0';
697 p++;
702 /*******************************************************************
703 * WCMD_output - send output to current standard output device.
707 void WCMD_output (char *format, ...) {
709 va_list ap;
710 char string[1024];
712 va_start(ap,format);
713 vsprintf (string, format, ap);
714 va_end(ap);
715 WCMD_output_asis(string);
719 static int line_count;
720 static int max_height;
721 static BOOL paged_mode;
723 void WCMD_enter_paged_mode(void)
725 CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
727 if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &consoleInfo))
728 max_height = consoleInfo.dwSize.Y;
729 else
730 max_height = 25;
731 paged_mode = TRUE;
732 line_count = 5; /* keep 5 lines from previous output */
735 void WCMD_leave_paged_mode(void)
737 paged_mode = FALSE;
740 /*******************************************************************
741 * WCMD_output_asis - send output to current standard output device.
742 * without formatting eg. when message contains '%'
745 void WCMD_output_asis (char *message) {
746 DWORD count;
747 char* ptr;
748 char string[1024];
750 if (paged_mode) {
751 do {
752 if ((ptr = strchr(message, '\n')) != NULL) ptr++;
753 WriteFile (GetStdHandle(STD_OUTPUT_HANDLE), message,
754 (ptr) ? ptr - message : lstrlen(message), &count, NULL);
755 if (ptr) {
756 if (++line_count >= max_height - 1) {
757 line_count = 0;
758 WCMD_output_asis (anykey);
759 ReadFile (GetStdHandle(STD_INPUT_HANDLE), string, sizeof(string), &count, NULL);
762 } while ((message = ptr) != NULL);
763 } else {
764 WriteFile (GetStdHandle(STD_OUTPUT_HANDLE), message, lstrlen(message), &count, NULL);
769 /***************************************************************************
770 * WCMD_strtrim_leading_spaces
772 * Remove leading spaces from a string. Return a pointer to the first
773 * non-space character. Does not modify the input string
776 char *WCMD_strtrim_leading_spaces (char *string) {
778 char *ptr;
780 ptr = string;
781 while (*ptr == ' ') ptr++;
782 return ptr;
785 /*************************************************************************
786 * WCMD_strtrim_trailing_spaces
788 * Remove trailing spaces from a string. This routine modifies the input
789 * string by placing a null after the last non-space character
792 void WCMD_strtrim_trailing_spaces (char *string) {
794 char *ptr;
796 ptr = string + lstrlen (string) - 1;
797 while ((*ptr == ' ') && (ptr >= string)) {
798 *ptr = '\0';
799 ptr--;
803 /*************************************************************************
804 * WCMD_pipe
806 * Handle pipes within a command - the DOS way using temporary files.
809 void WCMD_pipe (char *command) {
811 char *p;
812 char temp_path[MAX_PATH], temp_file[MAX_PATH], temp_file2[MAX_PATH], temp_cmd[1024];
814 GetTempPath (sizeof(temp_path), temp_path);
815 GetTempFileName (temp_path, "WCMD", 0, temp_file);
816 p = strchr(command, '|');
817 *p++ = '\0';
818 wsprintf (temp_cmd, "%s > %s", command, temp_file);
819 WCMD_process_command (temp_cmd);
820 command = p;
821 while ((p = strchr(command, '|'))) {
822 *p++ = '\0';
823 GetTempFileName (temp_path, "WCMD", 0, temp_file2);
824 wsprintf (temp_cmd, "%s < %s > %s", command, temp_file, temp_file2);
825 WCMD_process_command (temp_cmd);
826 DeleteFile (temp_file);
827 lstrcpy (temp_file, temp_file2);
828 command = p;
830 wsprintf (temp_cmd, "%s < %s", command, temp_file);
831 WCMD_process_command (temp_cmd);
832 DeleteFile (temp_file);