Solved

Need to Print Script Output to a Log

Posted on 2008-10-15
3
797 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
ID: 22728650
I figured it out.  Sorry for the fals alarm..
0
 
LVL 6

Expert Comment

by:deiaccord
ID: 22729469
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
ID: 22729593
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

943 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

7 Experts available now in Live!

Get 1:1 Help Now