How to Redirect Standard Output w/ START command?

  • Thread starter Thread starter Brian Gibson
  • Start date Start date
B

Brian Gibson

This does not redirect the outpout to the log file...

START CMD /C essmsh CSR.build.outline.CSRCALC.mxl>CSRCALC.LOG

What part is wrong? Can it be done?

Thanks.
 
In said:
This does not redirect the outpout to the log file...

START CMD /C essmsh CSR.build.outline.CSRCALC.mxl>CSRCALC.LOG

What part is wrong? Can it be done?

Don't know "essmsh" but try using a Space delimiter.
(and I always find it wise to just put in the quotes for "Title")

START "" CMD.exe /C essmsh CSR.build.outline.CSRCALC.mxl >CSRCALC.LOG
 
Brian Gibson said:
This does not redirect the outpout to the log file...

START CMD /C essmsh CSR.build.outline.CSRCALC.mxl>CSRCALC.LOG

What part is wrong?

Nothing. Sort of. You are redirecting the output of the start command to
CSRCALC.LOG which you'll find as a zero byte file in the current directory.
There's no output from the start command so nothing in the file.
Can it be done?

Off the top of my head use a batch file with the redirection in the batch.

:: MyBat.cmd
essmsh CSR.build.outline.CSRCALC.mxl>CSRCALC.LOG

Then
start cmd /c MyBat.cmd
or such...
 
The use of START with CMD makes no sense to me. What are
you really trying to do?

Does this not work?

essmsh CSR.build.outline.CSRCALC.mxl>CSRCALC.LOG

If it is because essmsh launches a new thread, outside of
the current console window, adding the START and CMD will
do nothing to contain it - PLUS, this almost certainly
means its output cannot be redirected in the first place.

Tom Lavedas
===========
 
Brian Gibson said:
This does not redirect the outpout to the log file...

START CMD /C essmsh CSR.build.outline.CSRCALC.mxl>CSRCALC.LOG

What part is wrong? Can it be done?
I don't know if the other tips have been succesfull,
but this one worked for me:

START CMD /C essmsh CSR.build.outline.CSRCALC.mxl^>CSRCALC.LOG

The redirection needs to be escaped with a ^
to be delayed into the started cmd.

HTH
 
Here is a sample of code that worked in a BATCH file launching VBScripts with the START command. It will lauch the seperate process and put the results into the specified log file. With this format you should be able to run any program and redirect the console mode output to a log file. Using the '^' is the key to this.

rem ================================================
rem Setting the passed device to run against to a varible
SET Audit_Device=%1

rem Launching "_SomeScript.vbs" in a seperate window
start "WindowTitle" /d%~dp0 cmd /C cscript.exe ^"%~dp0_SomeScript.vbs^" %Audit_Device% ^>^"%~dp0%Audit_Device%_SomeScriptLogFile.txt^"

rem Launching "ListPermissionsForAllShares-Basic-and-Detailed.vbs" in a seperate window
start "List Share Permission" /d%~dp0 cmd /C cscript.exe ^"%~dp0ListPermissionsForAllShares-Basic-and-Detailed.vbs^" %Audit_Device% ^>^"%~dp0%Audit_Device%_Share_Permissions.txt^"
 
Back
Top