Computing.Net > Forums > Programming > batch scripting

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

batch scripting

Reply to Message Icon

Name: compu-angus
Date: November 15, 2007 at 10:03:12 Pacific
OS: windows xp
CPU/Ram: 512mb
Product: dell
Comment:

Hi,
I have a litle dos batch script run schedule every night, how do I modify the dos batch script so that I want everything the output on the screen save as a log file? thanks



Sponsored Link
Ads by Google

Response Number 1
Name: tonysathre
Date: November 15, 2007 at 10:33:51 Pacific
Reply:

Append >> log.txt to your echo commands.

"Computer security." — Oxymoron


0

Response Number 2
Name: compu-angus
Date: November 15, 2007 at 10:48:46 Pacific
Reply:

here is my script: can you help me where to put append commnad to save log file?

@echo off
echo "This batch will shutdown all PCs"

psshutdown -r -c -f -t 30 \\computer1 -m "This PC will shut down in 10 sec to complete software upgrade."


0

Response Number 3
Name: tonysathre
Date: November 15, 2007 at 14:01:04 Pacific
Reply:

Sure,

@echo off
echo "This batch will shutdown all PCs"

psshutdown -r -c -f -t 30 \\computer1 -m "This PC will shut down in 10 sec to complete software upgrade." >> log.txt

"Computer security." — Oxymoron


0

Response Number 4
Name: Razor2.3
Date: November 15, 2007 at 14:51:23 Pacific
Reply:

You might also want to tack on 2>&1 to the end of tonysathre's line.


0

Response Number 5
Name: compu-angus
Date: November 16, 2007 at 06:11:20 Pacific
Reply:

thank so much, it works great!


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

Please, I need help so ba... omit in findstr



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch scripting

batch script to parse filenames www.computing.net/answers/programming/batch-script-to-parse-filenames/15286.html

Batch Script Help Needed www.computing.net/answers/programming/batch-script-help-needed/14475.html

batch script www.computing.net/answers/programming/batch-script/14086.html