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
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