?
Solved

Need to Print Script Output to a Log

Posted on 2008-10-15
3
Medium Priority
?
805 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month12 days, 13 hours left to enroll

777 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