Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7870869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:44:17+00:00 2026-06-03T01:44:17+00:00

so i’m trying to figure this out and i don’t think my scripting skills

  • 0

so i’m trying to figure this out and i don’t think my scripting skills are up to par. 🙁

basically what i’m trying to do is this.

have a script call a file, the file has a list of members servers that i want to look through. i want to search for a file on each one of those servers and then spit out a log that lists that file’s path.

so.. for example the file that is to be referenced is text.txt and within that file lists server 1, 2, 3.

i want to scan each server in this path c:\temp\ all sub dirs and look for file.exe

then spit out a log that displays the server and its path location of file.exe

server1 c:\temp\dir1\file.exe
server2 c:\temp\dir3\dir5\file.exe

anybody??? 🙁

thanks in advance!

this is what i’ve done so far…

@ECHO OFF
SET FLNM=file.exe
SET DRV=c
SET DIRS=temp
IF NOT DEFINED FLNM GOTO NAME
IF /I "%FLNM%"=="/Q" GOTO :EOF
SET FLNM=%FLNM: =.%
:DV
IF NOT DEFINED DRV GOTO DV
IF EXIST RESULTS.TXT DEL RESULTS.TXT
IF DEFINED DIRS SET DIRS=%DIRS: =.%
FOR %%D IN (%DRV%) DO (
    FOR %%G IN (%FLNM%) DO (
        IF DEFINED DIRS (
            FOR %%C IN (%DIRS%) DO (
                DIR %%D:\ /L /B /S|FINDSTR /I /E \%%C.\%%G>>RESULTS.TXT
            )
        ) ELSE (
            DIR %%D:\ /L /B /S|FINDSTR /I /E \%%G>>RESULTS.TXT
        )
    )
)
CALL :ZEROBYTE RESULTS.TXT
IF NOT EXIST RESULTS.TXT ECHO:"FILES NOT FOUND">>RESULTS.TXT
START NOTEPAD RESULTS.TXT
EXIT /B
:ZEROBYTE
IF %~Z1==0 DEL RESULTS.TXT
GOTO :EOF

i can get this to run locally on each but i rather run it centrally. also i can’t seem to get it to look under all the directories. if i list a directory, it only scans within that root only.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:44:18+00:00Added an answer on June 3, 2026 at 1:44 am

    If test.txt is formatted like this:

    server1
    server2
    server3
    

    then you could do this:

    for /f %s in (test.txt) do dir/s/b \\%s\c$\temp\file.exe
    

    Note that you need to be a domain administrator to do this for remote Windows Vista/7/Server 2008/R2 computers, but for Windows 2000/XP/Server 2003 you only need to have local administrator rights to each PC.

    Alternatively you could share the temp folder on each PC e.g. using net share temp$=C:\temp and then you could use \\%s\temp$\file.exe instead, then you would only need normal share and file permissions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
Basically, what I'm trying to create is a page of div tags, each has
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.