Solved

Ouput to file

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 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