Solved

Ouput to file

Posted on 2013-02-03
2
165 Views
Last Modified: 2013-02-04
This little runs fine and I can see the display flashed on teh screen . How do I capture the infos and write it to a file

Set FSO = CreateObject("Scripting.FileSystemObject")
Set FTO = FSO.CreateTextFile("d:\log.txt", True)                  
Set WshShell = WScript.CreateObject ("WScript.Shell")
 
IPAddress = InputBox("Enter IP addresss :")
UserId    = InputBox("Enter User ID :")

If IPAddress = "" or UserID = "" then
   wscript.quit
End If
         
strcommand = "d:\psexec.exe \\" & ipaddress & " -u ?????\" & UserID & " -p ????? net use "
wshshell.run strcommand
0
Comment
Question by:Bianchi928
2 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 150 total points
ID: 38849939
Hi again,

You can change this line:
strcommand = "d:\psexec.exe \\" & ipaddress & " -u ?????\" & UserID & " -p ????? net use "

to this
strcommand = "d:\psexec.exe -accepteula -u ?????\" & UserID & " -p ????? \\" & ipaddress & " cmd /c net use >> \\server\share\textfile.txt"

Rob.
0
 

Author Closing Comment

by:Bianchi928
ID: 38852388
Perfect mate

Cheers
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

18 Experts available now in Live!

Get 1:1 Help Now