Link to home
Start Free TrialLog in
Avatar of Bianchi928
Bianchi928

asked on

Ouput to file

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
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bianchi928
Bianchi928

ASKER

Perfect mate

Cheers