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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check file exist's on computers in network

Status
Not open for further replies.

ChrisHaynes

Technical User
Mar 9, 2006
80
GB
Hi all,

I need help figuring out a way to check that all the computers on the company domain have a file existing in a certain directory (same on every computer).

We recently edited the current login script to add this file to all of the computers, but need to know that it is definately there.

Does anyone know a way of doing this?

Thanks in advance,

Chris.

 
One way is to use the FILE() function:
Code:
IF FILE(\\host\share\file)
-or-
Code:
IF FILE(\\IP\share\file)

For example,
Code:
IF File('\\DSummZZZ\c_drive\MyFile.txt')
   Do Stuff
ELSE
  not there
ENDIF
-or-
IF File('\\123.123.123.123\c_drive\MyFile.txt')
   Do Stuff
ELSE
  not there
ENDIF
But you would have to know the share name of the hard drive ahead of time.
I'm sure there's an API function to get that too, but I'm not sure what it would be.

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Watch out for file() though - remember it will check the VFP search paths BEFORE it checks your specified one (not 100% sure if that is true of a share!).


Regards

Griff
Keep [Smile]ing
 
Thanks alot for your help!

I have decided to create a batch file instead,

Regards,

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top