-
November 12th, 2005, 03:52 AM
#1
Batch File Help
I want to connect to other computers on network to seach its hard drive to see if a file exist. This will be done over LAN.
Example:
A) a text file contains a list of computer names
computer1, computer2, computer3
B) I want batch to search C:\winnt\ for a file called mytext.txt
C) if mytext.txt exists I want it to print the name of the computer to a text file.
Any help...?
-
November 12th, 2005, 07:42 AM
#2
Driver Terrier
well there are alot of pitfalls that you may have to overcome... one of which is firewalling, another is sharing the root of a drive. These things your batch file will not be able to do.
If I understand B) correctly you want to search the computer on the lan's C\winnt not the local one.
IF EXISTS \\computername\sharename\directory\filename
is the code you need.
You will then need something to check the ERRORLEVEL that dos returns if it does or does not exist.
breakdown of batch file commands here
and all other dos commands here
Never, ever approach a computer saying or even thinking "I will just do this quickly."
-
November 14th, 2005, 10:16 PM
#3
I know you said bat file... but if you were doing it manually, you could try:
net use e: \\computername\c$
e:\
dir mytext.txt /s
"e:" is an arbitrarily chosen drive letter to which you are mapping the root of C: on the remote computer. To do this, you need administrative rights on the remote computer or on the domain.
dir /s is a directory list search command.
Last edited by houseisland; November 14th, 2005 at 10:18 PM.
Similar Threads
-
By alistair91 in forum Windows XP
Replies: 2
Last Post: August 31st, 2004, 12:10 PM
-
By Cleetus in forum Tech-To-Tech
Replies: 13
Last Post: July 10th, 2003, 04:38 AM
-
By sp3tiger in forum Windows NT/2000
Replies: 3
Last Post: January 18th, 2003, 01:11 PM
-
By gl993 in forum Tech-To-Tech
Replies: 11
Last Post: July 19th, 2001, 04:45 AM
-
By gl993 in forum Tech-To-Tech
Replies: 1
Last Post: December 5th, 2000, 06:27 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks