Solved

Need to Print Script Output to a Log

Posted on 2008-10-15
3
796 Views
Last Modified: 2012-05-05
I know this is somewhat basic but I cannot get this script to print to a log and it is driving me nuts.  It doesnt fail it just sits on the printing part for a very long time and then finally goes past without error only nothing shows up on my file.  What the script is doing is looking at pip files to spit out the last access date so we can find out if users are actually using their products.  I do not know if this is going to append or replace the file so i will need to address that as well but right now it does not print the script output at all.  I want it to print the entire dos window complete as I also have it spitting out the machine name so we will know what we are looking at in the log.  Any suggestions on why it will not print. I have admin rights on the test machine and it still does not want to write to the file.
cd\

cd documents*
 

net user
 

dir *.pip /S /T:A
 

PRINT c:\lag\project.log

Open in new window

0
Comment
Question by:TheITGuy
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
TheITGuy earned 0 total points
Comment Utility
I figured it out.  Sorry for the fals alarm..
0
 
LVL 6

Expert Comment

by:deiaccord
Comment Utility
To clarify for people who find this you can redirect output usin the > symbol to a file (or >> to append)

So in this example something like the below was probaly user to create or overwrite the log file when run.

dir *.pip /S /T:A > c:\lag\project.log
0
 
LVL 1

Author Comment

by:TheITGuy
Comment Utility
Here is what I ended up with.  Sorry.. I should have clarified.


c:

cd\

cd documents*
 

Set Logfile=\\dts19\smssour\msprojcomp\log\%computername%.log
 

net user>>%logfile%
 

dir *.pip /S /T:A>>%logfile%
 

exit

Open in new window

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now