![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | out-file write-host $computer "(Not found)" "`r" | out-file -filepath D:\results.txt -append how come the file is empty ? |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | RE: out-file Write-host writes to the console and has no output. Please try: "$computer (Not found)`r" | out-file -filepath D:\results.txt -append regards Michiel "IT Staff" wrote:
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||
| Guest | Re: out-file Either you write to the console or to the file. If you need to write to both, use tee-object: "$computer (Not found)`r" | tee-object -filepath D:\results.txt ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #4 (permalink) | ||||||||||||||||||||||||
| Guest | Re: out-file using tee-object does not have append parameter ? "MichielV" <MichielV@xxxxxx> wrote in message news:3D5B470A-271D-469F-9A75-C00D3718B61A@xxxxxx
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #5 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: out-file No. You can write a function to mimic its behaviour: function Write-ToConsoleAndFile($path,$text){ write-host $text out-file -filepath $path -inputObject $text -encoding ASCII -append -force } $computers = "box1","box2","box3" $computers | foreach { Write-ToConsoleAndFile D:\results.txt "$_ (Not Found)" } ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic
| ||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Scheduled task (run .bat file) fails every time with 0x80070002 (file not found) | Ben Dilts | Vista General | 2 | 07-22-2008 08:50 AM |
| Create New folder, move file, delete file. Explorer Freeze | erod49 | General Discussion | 10 | 05-20-2008 05:38 AM |
| file icons dont match contents-file names hidden | Fosbury | Vista file management | 0 | 05-07-2008 05:48 PM |
| coping file from a remote file share - FILE IS NO LONG THERE bogus error message | Heith | Vista networking & sharing | 0 | 10-18-2007 03:58 PM |
| File Open and File Save As Dialog Freeze and Hang All Applications | =?Utf-8?B?TGlnaHRmb290ZQ==?= | Vista file management | 0 | 07-12-2006 11:39 AM |