Solved

Ouput to file

Posted on 2013-02-03
2
169 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to open text file 11 136
VBScript on Html 15 55
Having trouble with a VB Script 17 31
Append multiple Excel workbooks with multiple sheets into a new workbook 44 81
This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

713 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