Redirect STDOUT and STDERR to the same place

I was deploying a SharePoint solution today and had put together a bunch of .cmd files for the operations team to use. So I sat with the team as they ran the scripts and lo and behold I had deployed the .wsp with the debug dll instead of the release .dll so some of my feature activation code broke (the debug code was looking for security groups that existed on my dev box).

Anyway, what I had done was give the team the instructions to run the .cmd files like so:

C:\DeploymentFolder\ActivateFeatures.cmd > ActivateFeaturesOutput.txt

When the operations person ran this I noticed that the error message appeared in the command prompt – hmmmmm. Of course the operations person just said “oh that’s because your STDOUT and STDERR are two different things, Unix you know”.

A quick search and I found that what I should have done was:

C:\DeploymentFolder\ActivateFeatures.cmd 1> ActivateFeaturesOutput.txt 2>&1

Courtesy of

This entry was posted in SharePoint and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s