Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Ouput to file

Posted on 2013-02-03
2
Medium Priority
?
174 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 600 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 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