Need to extract full paths from Recent file .lnk files

Discussion in 'AutoCAD' started by David Allen, Apr 21, 2004.

  1. David Allen

    David Allen Guest

    c:\Documents and Settings\<username>\Application Data\Autodesk\AutoCAD\Recent\
    There is a bunch of .lnk files.
    I need to extract the full path of the .lnk files to a txt file.
    Any ideas?

    David
     
    David Allen, Apr 21, 2004
    #1
  2. David Allen

    BillZ Guest

    (foreach n (dos_dir (strcat path "*.lnk"))(setq lt1 (cons
    (findfile (strcat path n)) lt1)))

    (setq fl (open mytextfile.txt") "w")

    (foreach n lt1
    (write-line n fl)
    )
    (close fl)

    Bill
     
    BillZ, Apr 21, 2004
    #2
  3. David Allen

    Mike Weaver Guest

    Mike Weaver, Apr 21, 2004
    #3
  4. David Allen

    David Allen Guest

    that would not extract the full path from the .lnk files

    BillZ <>
    |>(foreach n (dos_dir (strcat path "*.lnk"))(setq lt1 (cons
    |>(findfile (strcat path n)) lt1)))
    |>
    |>(setq fl (open mytextfile.txt") "w")
    |>
    |>(foreach n lt1
    |> (write-line n fl)
    |> )
    |>(close fl)
    |>
    |>Bill


    David
     
    David Allen, Apr 21, 2004
    #4
  5. David Allen

    David Allen Guest

    I don't need it inside autocad. Just need to convert the .lnk files to full path

    Ok I can cut-n-paste some of the example code to a .vbs but I have no idea how to modify that into what I need to do?


    "Mike Weaver" <mweaver AT bettisworth DOT com>
    |>David,
    |>lnk files are windows shortcuts and can be accessed/modified via active-x
    |>applications using the windows scripting host (WSH) object model. This will
    |>show you some basics using vbscript and jscript:
    |>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsObjWshShortcut.asp
    |>or: http://tinyurl.com/3b8fk
    |>
    |>WSH can be accessed using vlisp (see Tony Tanzillo's site for some examples)
    |>or VBA. Or just use VBScript.
    |>
    |>Hope that helps,
    |>Mike Weaver
    |>
    |>
    |>|>> c:\Documents and Settings\<username>\Application
    |>Data\Autodesk\AutoCAD\Recent\
    |>> There is a bunch of .lnk files.
    |>> I need to extract the full path of the .lnk files to a txt file.
    |>> Any ideas?
    |>>
    |>> David
    |>


    David
     
    David Allen, Apr 21, 2004
    #5
  6. David Allen

    David Allen Guest

    Thankx Mike
    I don't want to sound ungrateful, but its not quite working for me.
    I drag in 15 files and it places the paths in an odd sorting order. I am not sure
    what the order is. Try your vbs on
    C:\Documents and Settings\<username>\Application Data\Autodesk\AutoCAD\Recent\Select File\
    and you will see what I mean.

    I was wondering if it could extract one at a time. Then it can be ran from a batch file with a for each .lnk run it.
    Then if possible append the result to a text file.

    btw if the txt file does not exist it dies :)

    I got about a 1000 files to look through in this guys recent file list to see if he was working on company drawings
    or was moonlighting. Not a fun task, but the boss wants the info.

    "Mike Weaver" <mweaver AT bettisworth DOT com>
    |>David,
    |>Here is a rough vbs file (rename the extension to vbs). Note that this will
    |>only do 15 shortcuts at a time - a limitation of the scripting system.
    |>
    |>Put the vbs file anyplace then drag and drop up to 15 shortcuts onto the vbs
    |>file. The resulting text file will be created in the same folder as the
    |>first shortcut in the list.
    |>
    |>Hope this helps,
    |>Mike Weaver
    |>
    |>
    |>|>> I don't need it inside autocad. Just need to convert the .lnk files to
    |>full path
    |>>
    |>> Ok I can cut-n-paste some of the example code to a .vbs but I have no idea
    |>how to modify that into what I need to do?
    |>>
    |>>
    |>> "Mike Weaver" <mweaver AT bettisworth DOT com>
    |>> |>David,
    |>> |>lnk files are windows shortcuts and can be accessed/modified via
    |>active-x
    |>> |>applications using the windows scripting host (WSH) object model. This
    |>will
    |>> |>show you some basics using vbscript and jscript:
    |>>
    |>|>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/
    |>html/wsObjWshShortcut.asp
    |>> |>or: http://tinyurl.com/3b8fk
    |>> |>
    |>> |>WSH can be accessed using vlisp (see Tony Tanzillo's site for some
    |>examples)
    |>> |>or VBA. Or just use VBScript.
    |>> |>
    |>> |>Hope that helps,
    |>> |>Mike Weaver
    |>> |>
    |>> |>
    |>> |>|>> |>> c:\Documents and Settings\<username>\Application
    |>> |>Data\Autodesk\AutoCAD\Recent\
    |>> |>> There is a bunch of .lnk files.
    |>> |>> I need to extract the full path of the .lnk files to a txt file.
    |>> |>> Any ideas?
    |>> |>>
    |>> |>> David
    |>> |>
    |>>
    |>>
    |>> David
    |>


    David
     
    David Allen, Apr 26, 2004
    #6
  7. David Allen

    Mike Weaver Guest

    David,
    The odd sorting order is caused by the way the windows file selection dialog
    returns the values. You will find the files reverse order except hot file,
    the one with the rubberband around it in explorer, will be listed first.

    With that many files the script should be rewritten with a hardcoded text
    file name then it should simply cycle through all the lnks in the folder.

    If you would like me to finish this for you, email me and let's talk about
    it.

    Mike
    mweaverATbettiswrothDOTcom

    Data\Autodesk\AutoCAD\Recent\Select File\
    from a batch file with a for each .lnk run it.
    see if he was working on company drawings
     
    Mike Weaver, Apr 27, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.