Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: batch file to find all the .exe ,mp3,msi files and list the path such file  (Read 22396 times)

0 Members and 1 Guest are viewing this topic.

Aditi gupta

    Topic Starter


    Rookie

    • Experience: Experienced
    • OS: Windows 7
    this is again creating the file on my desktop

    just use the full path >>"\\server\share\file.log"


    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Try this after changing the ip address/server and folder.

    @echo off
    set "host=\\xx.xx.xx.xx\folder\%COMPUTERNAME%.txt"
    echo %host%
    for %%a in (c d e f g h i) do if exist "%%a:\" (
    dir /b /s /a-d "%%a:\*.exe" "%%a:\*.mp3" "%%a:\*.msi" |find /v /i "c:\program files\" |find /v /i "c:\programdata\"|find /v /i "c:\windows\" >>"%host%"
    )
    echo "Scanning Completed!!" >> "%host%"
    pause

    Aditi gupta

      Topic Starter


      Rookie

      • Experience: Experienced
      • OS: Windows 7
      awsome, thanks a lot foxidrive.

      you are genius.


      foxidrive



        Specialist
      • Thanked: 268
      • Experience: Experienced
      • OS: Windows 8
      Squashman - hand holding, right?

      Squashman



        Specialist
      • Thanked: 134
      • Experience: Experienced
      • OS: Other

        "%host%.txt" >> net use N: \\xx.xx.xx.xx\folder\
      This is not valid syntax and please use Bulletin Board Code tags when posting code.

      In your original questions it sounded like you wanted to redirect the output from the code directly to the network share.  Now it looks like you want to copy a file to the network share.  If you want to copy the file to the network share then use the COPY or XCOPY commands.  I believe both of them support UNC paths.

      Squashman



        Specialist
      • Thanked: 134
      • Experience: Experienced
      • OS: Other
      awsome, thanks a lot foxidrive.

      you are genius.
      Yes.  It is Rocket Surgery.

      CrazyJay265



        Newbie

        • Experience: Beginner
        • OS: Unknown
        Code: [Select]
        @echo off
        for %%a in (d e f g h i j k l) do if exist "%%a:\" dir /b /s /a-d "%%a:\*.exe" "%%a:\*.mp3" "%%a:\*.msi" >>"%userprofile%\desktop\results.txt"

        Hello, Im trying to figure out how to make a bat file and it would ask me what song if like to search for then if I have it to say I have it and if not the to seach it on say youtube automatically
        Something like
        @Echo off
        title Song search
        Echo What song would you like to seach today?
        Enter name
        *Search the name* if not found play the song in youtube

        Please help and thank you