Good day dear,
My knowledge of scripting is very limited, so I would like the help of the community in the following question.
We have some excel files for 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 like a txt log with the computer name to be created in a folder on the network by pointing to the result (the folders containing those files).
Some considerations:
The batch will be executed locally using a deploy through automatos software, so the user running the batch will be the system;
-I do not want the user to know that this search is being executed;
- If the files do not exist on the user machine, there is no need for logging, simply by stopping the batch.
As I said, I do not have much advanced script knowledge, what I've discovered so far is that I can use DIR to fetch the file and print it on the screen as below:
dir setup.txt /s
Of course, in addition to being super simple, the code does not define paths and nor does it search other local drives besides C. It is worth mentioning that users have mapped network folders and I do not want to search inside them. >
My question is: how to translate my need into code?
Thank you immediately to anyone who is ready to help. Any ideas will be welcome and tested accordingly.
Thank you and have a great day everyone
* Update:
I found this code here that is already something. It does not print the search results in the log txt with the path of the files found, but it 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 by improving it, I thank you right away.