I have been asked to write a script to audit local drives of all
workstations for any PST files. I found a script, from another thread here a
few years back, which I have tried to modify to write found files to a text
document but I can't get it to write all files found to a text document.
It will write files found on the C:\ drive to the text document but there
are some on a second drive (D:\) but I get a script error stating "Permission
Denied". When I click on on the error box, it proceeds to write the text file
but only with what was found on the C:\ drive.
However, if I comment out all lines relating to creating & writing to the
TextFile, the Wscript.Echo will display PST files on the D:\ drive as well
as the C:\ drive.
My script is as follows:
Set objWSHShell = Wscript.CreateObject("Wscript.Shell")
strLogonServer = objWSHShell.ExpandEnvironmentStrings("%LOGONSERVER%")
Set objNet = CreateObject("Wscript.Network")
strComputer = objNet.ComputerName
I have checked security permissions on the drive and I have full control
over it besides wscript.echo does display contents of all drives so I don't
believe it is a permissions issue on the drive itself.
Can someone help me where I am going wrong? I'm sure it is something simple
I am overlooking.