Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Files Exist

Status
Not open for further replies.

LeighTT

Technical User
Feb 12, 2003
15
0
0
GB
I have a script that runs a net use command to remote
workstations Admin$. Once the Net use authentication takes place I need to confirm I have access to files within the
share. If I were using shell script I would run the following command.

If file Exists \\Workstation\admin\*.*

However as far as I can see you cannot use wildcards using the FileExists method in VBscript.

Can anybody give me a suggestion of how best to get round this problem......
 
You can instantiate a Folder object and browse its Files collection.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
LeighTT,

You can try this in vbs.
[tt]
if createobject("scripting.filesystemobject).getfolder("\\Workstation\admin").files.count<>0 then
[/tt]
Of course, you've to make sure the share established.

regards - tsuji
 
Thanks for your responses, its now working a treat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top