How to read text files on remote servers without mapping/unmapping drives?



1) We have a script that maps and unmaps drives.
This script is an audit script. So it is called say from Box1 to
BoxA, BoxB, BoxZ etc...
To find out where BoxA-BoxZ have been running backups, the script
interrogates
the backup logs on BoxA-BoxZ.

To read the BoxA-BoxZ the script maps a drive ( V: in this instance)

objNetwork.MapNetworkDrive "V:", "\\" & strComputer & "\" & "C$", ,
strUser, strPwd
and open to read the back up logs
strFilePath = "V:\Program Files\Tivoli\TSM\baclient
\dsmsched.log"

When finished the drive gets disconnected/unmapped.

If there multiple script jobs running concurrently, this could be a
problem as there could be a job querying the log file as the volume
could have been dismounted from another job.

What would be the best way to read the log on a server without
mounting the drives?

2) Another reason for mounting the drives,
there are some windows commands like "ipconfig" we usually run the
command, save as a text file
errReturn = objProc.Create ("cmd.exe /c ipconfig > C:\temp
\ipview.txt", Null, Null, intPID)

Is there a better way of executing command and read the output
directly without having to creating an extra file?
.



Relevant Pages