1 Replies - 1731 Views - Last Post: 05 February 2013 - 08:56 PM Rate Topic: -----

#1 calvinthedestroyer   User is offline

  • D.I.C Lover

Reputation: 172
  • View blog
  • Posts: 1,932
  • Joined: 13-October 07

Batch file help

Posted 05 February 2013 - 01:12 AM

Hello, (not sure if we have a batch sub forum)

I want to run my batch file so that it pipes standard-out and standard-error info to files but I would also like to see the standard-out ECHO-ed to the console, (that way the user knows when the test program is done)

Can I put a third flag for >con ?

Here is my batch file:
rem Working directory.
cd \
cd \Program Files\Philips\CIRS\DiskDiag

rem set TAC number as file name.
set /p testout= Enter TAC# for use as the file name?
set /p flash= Enter the letter of the flash drive (ie g, e)

rem the test will want "Y" for input but the user will not be able to see it.
echo press "y" / "Y" wait a bit the press "y" / "Y" again

rem command line.
c:\windows\system32\cscript.exe rundisktestf.vbs /v /r:3 >"%flash%":\"%testout%".txt 2> "%testout%"errors.txt


Is This A Good Question/Topic? 0
  • +

Replies To: Batch file help

#2 GunnerInc   User is offline

  • "Hurry up and wait"
  • member icon

Reputation: 917
  • View blog
  • Posts: 2,358
  • Joined: 28-March 11

Re: Batch file help

Posted 05 February 2013 - 08:56 PM

Not sure if I understand you correctly, but there are a few things you could do.
1. To turn on display of the current command, use @ECHO ON, and to turn off, use @ECHO OFF
2. At the end of the batch file, use pause to get press any key to continue.
3. Use labels, and jump to a "done" label and echo a finished string or something.

For #1 this is the sample code I used:
echo Commandline display off
cd \BatBack

echo Turning on commandline display
cd \BatBack
echo ON DONE

And the output:
Posted Image
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1