need help to improve little script

Home Forums Scripting General Scripting need help to improve little script

  • This topic has 9 replies, 2 voices, and was last updated 11 years ago by Avatarmla.
Viewing 1 post (of 1 total)
  • Author
  • Avatar

    I need to find particular file format on networked comps, and have a report for each pc.
    I found a nice script on the blog. It does the job, but lists all the files on C:
    There is a line in additional post that should basically list files only for asked extentions.
    For some reason this line doesn’t work.
    Could somebody take a look and correct it. Thx. Michael.

    Here is the script. REM line is original. The line above is additional and should list only .doc *. xls *.ppt
    As I mentioned with original line only, it lists all the files. With the line above it says file not found. Sure I have files with extentions asked on target machines.
    I guess that the line: dir “%~1c$” /s /a /b *.doc *.xls *.ppt > “%~1.txt”
    missing a slash dir “%…
    If I add a slash it lists all files exactly like with the REM line.
    Machines.TXT is placed in the same folder as FIND.BAT (the script)

    What is missing?

    if “%1″==”” goto all
    echo Scanning %~1
    dir “%~1c$” /s /a /b *.doc *.xls *.ppt > “%~1.txt”
    rem dir “[URL=”file://\%~1c$”]\%~1c$[/URL]” /s /a /b > “%~1.txt”
    goto end
    for /f “delims=” %%i in (Machines.TXT) do call %0 “%%i”

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.