4
Good morning dear friends,
my knowledge of script is very limited and so I would like to count on the help of the community in the following question.
We have some excel files of specific names on users' computers. (Suppose: file1.xls, file2.xls and file3.xls) I want to run a batch to search for these specific files.
I would then like a txt log with the computer name to be created in a network folder pointing to the result (the folders containing those files).
Some considerations:
The batch will run locally using a deploy via software automates, so the user running the batch will be the system;
-I don’t want the user to know that this search is running;
-If the files do not exist on the user’s machine, there is no need for the log, simply the batch being stopped.
As I said, I don’t have much advanced knowledge in script, what I’ve discovered so far is that I can use DIR to fetch the file and print on screen as below:
dir setup.txt /s
But of course, in addition to being super simple, the code does not define paths and nor does it search for other local drives besides C. It is also worth saying that users have mapped network folders and I do not want to search within these.
My question is: how to translate my need into code?
I immediately thank those who are willing to help. Any idea will be welcome and tested accordingly.
Thank you and a great day to all
*Update:
I found this code here that’s something. It does not print the search results in the txt log with the path of the found files, but already tells me if the files exist or not:
dir /s /a-d setup.txt >nul && (echo found it) || (echo not found)
Who can help me improving immediately thank you.
only in the Root of the unit, or subfolders, of subfolders, etc., also?
– David
@David Subfolders too. If possible on all non-networked drives or cv/dvd drive. If this is not possible, on the whole c drive.
– Luiz Gustavo Batista