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

File properties of network computers using NETBIOS

Status
Not open for further replies.

JamesWeb

Programmer
Jan 14, 2002
7
0
0
NZ
Hi I'm trying to get the properties of a list of files using VB 6.0. I used the Attrib = GetAttr(FName) command to do this and it worked fine when the files were on my computer or when I explicitly listed files on another computer in my network.

Now however I want to set the program to get the file properties for a file (e.g. C:\autoexec.bat) , however it needs to do this for each NTEBIOS name I specify.
In other words I want to have a text file listing the computer names and want the program to look up those computers and retrieve the file properties for each computer.
Is its easy enough to do it by NETBIOS name or am I better of with IP address.

I tried getting the attributes for the DNS name but it didn’t work (e.g. \\COMPNAME\C:\autoexec.bat ).

This is the piece of code I’m having problems with

Open txtInput For Input As #1
Open txtOutput For Output As #2
Open "Properties_Error.log" For Output As #4 ‘Log file
Open TxtCompName For Input As #5 ‘The list of network comps I want props of

'Print the file header
Print #2, "File Name" & "," & "File Size" & "," & "File Date/Time Created" & "," & "Read Only - Hidden - System - Archive"

Do Until EOF(1)
Input #5, CompN
Do Until EOF(1) 'continue processing till EOF ture

Input #1, File 'read file name from txt file
'FName = "\\" + "compN" + "\" + File
Open FName For Input As #3
' Use GetAttr function to get all attributes info
Attrib = GetAttr(FName)


Anyone got any ideas?

Thanks heaps
James
 
your syntax is wrong...you have \\pcname\c:\autoexec.bat

it should be \\pcname\c$\autoexec.bat

hope this helps.
 
Thanks for your quick reply.
That I used the fixed syntax but still get a path error.

Any other ideas, in debug it comes through at //anna/C$/autoexec.bat but still doesn’t work.
 
You have:

'FName = "\\" + "compN" + "\" + File
Open FName For Input As #3


first; commented out the first line and then put inverted commas around compN

Also you opened the file try not opening it...
 
Thanks Guys for all your help, I have actually fixed the problem by refering to the share rather than C:\.

Thanks
James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top