#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Location
    Warsaw
    Posts
    46
    Rep Power
    29

    .cmd getting path script


    Code:
    @echo off
    FORFILES /P C:\ /M myfile.* /S /C "cmd /c echo @path 1>outfile.txt"
    Why it doesn't work even if I run it as administrator?
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,119
    Rep Power
    9398
    What does "doesn't work" mean?

    Also,
    Code:
    dir /s /b C:\myfile.* > outfile.txt

    Comments on this post

    • kutacz agrees
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Location
    Warsaw
    Posts
    46
    Rep Power
    29
    Originally Posted by requinix
    What does "doesn't work" mean?
    It didn't create an output file, there was a lot of errors in console: ("ERROR:Access denied") . So, it's better to do it in your way which is much simplier. Thanks a lot!

IMN logo majestic logo threadwatch logo seochat tools logo