Loading ...
Sorry, an error occurred while loading the content.

Bulk modifications of LNK parameters - howto?

Expand Messages
  • buralex@gmail.com
    Problem: My old computer died. I was able to recover the contents of its hard-drive but unfortunately, prior to its death I had deleted all the installers in
    Message 1 of 7 , Sep 28, 2007
    • 0 Attachment
      Problem: My old computer died. I was able to recover the contents of its
      hard-drive but unfortunately, prior to its death I had deleted all the
      installers in order to conserve space on its small (20 GB harddrive) w/o
      making backups. (The old computer didn't have a writable CD drive and I
      was STUPID!)

      I've been able to relocate installers on the internet for many of the
      programs (and fortunately) still have a file that contains registration
      keys etc. for those that require it.

      I reloaded the old (small) C:\ drive as C:\oldsys\ on my new (large)
      harddrive

      All told there are about 900 shortcuts (LNK files) pointing to the old
      Program file locations.

      * so for example this shortcut
      o Link location: C:\Documents and Settings\Alec\Start
      Menu\Programs\BK Color Coder\BK Color Coder.lnk
      + Target: "C:\Program Files\BK Color Coder\BK Color
      Coder.exe"
      + Start In: "C:\Program Files\BK Color Coder\"
      + Run: Normal
      * is now located at and **ought** to point to:
      o C:\oldsys\Documents and Settings\Alec\Start Menu\Programs\BK
      Color Coder\BK Color Coder.lnk
      o C:\oldsys\Program Files\BK Color Coder\BK Color Coder.exe

      If I could correct the Target and Start In fields with a "simple"
      ^!replace "C:\" >> "C:\oldsys" command then the old shortcuts would
      correctly point to the old locations and I'd be able to execute the old
      programs. Of course they still wouldn't be "installed" and some that
      depend on registry contents would fail but (as I've discovered through
      testing) many function just fine.

      From Clip HELP:

      * ^!MakeShortcut ShortcutLocation "Target" ["Arguments"]
      ["Description"] [CmdShow] (added in v4.8)
      * Creates Windows shortcuts. Syntax:
      * . ShortcutLocation is the place where the shortcut is created. It
      accepts the same values as the TypeFolder argument used in the
      ^$GetSpecialPath(TypeFolder)$ function. - "Target" is the program
      to execute, or the document to launch.
      * . "Arguments" are eventual command-line switches you might want to
      use with the target program.
      * . "Description" is an optional parameter you can use to identify
      the shortcut. If it is left blank, the shortcut name will be the
      same as the target program name.
      * . CmdShow defines how the program is opened. It can have one of
      the following values:
      * ---Normal (default if no value specified)
      * ---Maximized
      * ---Minimized
      * Example:
      * ^!MakeShortcut SendTo "^$GetAppFileName$" "" "Open in NoteTab"
      MAXIMIZED

      Unfortunately, Eric didn't include a ^!ChangeShortcut command :-(

      seems to me I can create new shortcuts quite easily if I could generate
      (say) a CSV file containing the required info from those 900 shortcuts
      but I haven't found any way either in Notetab or any other batch
      commands or freeware programs something that can be induced the report
      the required information.

      FWIW: while searching I did find these two links which describe how to
      create LNKs in an INF file which can be simply installed. The second
      link also includes the ability to set the shortcut ICON FILE which for
      some reason Eric didn't (or couldn't(?)) include in ^!MakeShortcut

      * http://www.robvanderwoude.com/amb_shortcutsnt.html
      * http://www.robvanderwoude.com/shortcutinf.html

      So ... anyone know how to get a report of the Target and Start_ins of
      all LNK files in a folder (and subfolders)?

      Regards ... Alec -- buralex-gmail
      --





      [Non-text portions of this message have been removed]
    • buralex@gmail.com
      ... Answering my own question ... google long enough and everything can be found :-) From: http://www.optimumx.com/download/ command-line program
      Message 2 of 7 , Sep 29, 2007
      • 0 Attachment
        buralex@... said on Sep 29, 2007 2:11 -0400 (in part):
        > So ... anyone know how to get a report of the Target and Start_ins of
        > all LNK files in a folder (and subfolders)?
        Answering my own question ... google long enough and everything can be
        found :-)

        From: http://www.optimumx.com/download/
        command-line program "shortcut.exe" supports Add | Modify | Query - yippee!

        From what I could find out "shortcut.exe" used to be part of Windows 95
        resource kit but apparently got dropped either for or before Windows
        Server 2003 Resource Kit. The owner of the Optimum X site appears to
        claim this version as his own work.

        * Command line:
        o shortcut /F:filename /A:C|E|Q [/T:target] [/P:parameters]
        [/W:workingdir]
        [/R:runstyle] [/I:icon,index] [/H:hotkey]
        [/D:description]
        * Sample output:
        o C:\bin>shortcut /F:asfilefinder.lnk /A:Q

        [asfilefinder.lnk]
        TargetPath=C:\bin\ASFileFinder.exe
        TargetPathExpanded=C:\bin\ASFileFinder.exe
        Arguments="C:"
        ArgumentsExpanded="C:"
        WorkingDirectory=C:\bin
        WorkingDirectoryExpanded=C:\bin
        RunStyle=1
        IconLocation=,0
        IconLocationExpanded=,0
        HotKey=0 (None)
        Description=

        The command completed successfully.

        Note: this also allows specification of Icon file and number and HotKey
        (not shown in above)
        Now its just a matter of generating the report of all my desired
        shortcuts and massaging the output back into the required command-line
        format.

        Regards ... Alec -- buralex-gmail
        --



        [Non-text portions of this message have been removed]
      • Larry Hamilton
        Alec, I found this program a short while ago too. It can do for shortcuts, the few things the ^!MakeShortcut command cannot do, that I need. The software I
        Message 3 of 7 , Sep 29, 2007
        • 0 Attachment
          Alec,

          I found this program a short while ago too. It can do for shortcuts, the
          few things the ^!MakeShortcut command cannot do, that I need.

          The software I support at work has complex shortcuts, that are a pain to
          change, since it has to be done manually.

          One of my back-burner projects is to create a clip or clips to handle
          this. But things never seem to slow down enough. ;-)

          Please share your clip(s) for addressing this issue.

          Larry Hamilton


          buralex@... wrote:
          > buralex@... said on Sep 29, 2007 2:11 -0400 (in part):
          >
          >> So ... anyone know how to get a report of the Target and Start_ins of
          >> all LNK files in a folder (and subfolders)?
          >>
          > Answering my own question ... google long enough and everything can be
          > found :-)
          >
          > From: http://www.optimumx.com/download/
          > command-line program "shortcut.exe" supports Add | Modify | Query - yippee!
          >
          > From what I could find out "shortcut.exe" used to be part of Windows 95
          > resource kit but apparently got dropped either for or before Windows
          > Server 2003 Resource Kit. The owner of the Optimum X site appears to
          > claim this version as his own work.
          >
        • junja
          Faced with a similar problem, I installed a program called AutoHotkey - a sort of keyboard manager. Now it manages all my hotkey keyboard shortcuts (bar one or
          Message 4 of 7 , Sep 29, 2007
          • 0 Attachment
            Faced with a similar problem, I installed a program called
            AutoHotkey - a sort of keyboard manager.
            Now it manages all my hotkey keyboard shortcuts (bar one or
            two).
            It takes a bit of work to set up (nothing beyond the powers
            of a clip writer) but that done, shortcut problems are over.
            One can, for instance, export all one's hotkey shortcuts
            (in a single file) to any machine one wants.
            junja

            http://www.autohotkey.com/

            buralex@... wrote:
            > Problem: My old computer died. I was able to recover the contents of its
            > hard-drive but unfortunately, prior to its death I had deleted all the
            > installers in order to conserve space on its small (20 GB harddrive) w/o
            > making backups. (The old computer didn't have a writable CD drive and I
            > was STUPID!)
            >
            > I've been able to relocate installers on the internet for many of the
            > programs (and fortunately) still have a file that contains registration
            > keys etc. for those that require it.
            >
            > I reloaded the old (small) C:\ drive as C:\oldsys\ on my new (large)
            > harddrive
            >
            > All told there are about 900 shortcuts (LNK files) pointing to the old
            > Program file locations.
            >
            > * so for example this shortcut
            > o Link location: C:\Documents and Settings\Alec\Start
            > Menu\Programs\BK Color Coder\BK Color Coder.lnk
            > + Target: "C:\Program Files\BK Color Coder\BK Color
            > Coder.exe"
            > + Start In: "C:\Program Files\BK Color Coder\"
            > + Run: Normal
            > * is now located at and **ought** to point to:
            > o C:\oldsys\Documents and Settings\Alec\Start Menu\Programs\BK
            > Color Coder\BK Color Coder.lnk
            > o C:\oldsys\Program Files\BK Color Coder\BK Color Coder.exe
            >
            > If I could correct the Target and Start In fields with a "simple"
            > ^!replace "C:\" >> "C:\oldsys" command then the old shortcuts would
            > correctly point to the old locations and I'd be able to execute the old
            > programs. Of course they still wouldn't be "installed" and some that
            > depend on registry contents would fail but (as I've discovered through
            > testing) many function just fine.
            >
            > From Clip HELP:
            >
            > * ^!MakeShortcut ShortcutLocation "Target" ["Arguments"]
            > ["Description"] [CmdShow] (added in v4.8)
            > * Creates Windows shortcuts. Syntax:
            > * . ShortcutLocation is the place where the shortcut is created. It
            > accepts the same values as the TypeFolder argument used in the
            > ^$GetSpecialPath(TypeFolder)$ function. - "Target" is the program
            > to execute, or the document to launch.
            > * . "Arguments" are eventual command-line switches you might want to
            > use with the target program.
            > * . "Description" is an optional parameter you can use to identify
            > the shortcut. If it is left blank, the shortcut name will be the
            > same as the target program name.
            > * . CmdShow defines how the program is opened. It can have one of
            > the following values:
            > * ---Normal (default if no value specified)
            > * ---Maximized
            > * ---Minimized
            > * Example:
            > * ^!MakeShortcut SendTo "^$GetAppFileName$" "" "Open in NoteTab"
            > MAXIMIZED
            >
            > Unfortunately, Eric didn't include a ^!ChangeShortcut command :-(
            >
            > seems to me I can create new shortcuts quite easily if I could generate
            > (say) a CSV file containing the required info from those 900 shortcuts
            > but I haven't found any way either in Notetab or any other batch
            > commands or freeware programs something that can be induced the report
            > the required information.
            >
            > FWIW: while searching I did find these two links which describe how to
            > create LNKs in an INF file which can be simply installed. The second
            > link also includes the ability to set the shortcut ICON FILE which for
            > some reason Eric didn't (or couldn't(?)) include in ^!MakeShortcut
            >
            > * http://www.robvanderwoude.com/amb_shortcutsnt.html
            > * http://www.robvanderwoude.com/shortcutinf.html
            >
            > So ... anyone know how to get a report of the Target and Start_ins of
            > all LNK files in a folder (and subfolders)?
            >
            > Regards ... Alec -- buralex-gmail
          • notetab_is_great
            ... AutoHotkey is a great program; I use it too. But Alex was talking about modifying path names within shortcuts icons, so that the icons work again when
            Message 5 of 7 , Sep 30, 2007
            • 0 Attachment
              --- In ntb-clips@yahoogroups.com, junja <junja@...> wrote:
              >
              >
              > Faced with a similar problem, I installed a program called
              > AutoHotkey - a sort of keyboard manager.
              > Now it manages all my hotkey keyboard shortcuts (bar one or
              > two).
              > It takes a bit of work to set up (nothing beyond the powers
              > of a clip writer) but that done, shortcut problems are over.
              > One can, for instance, export all one's hotkey shortcuts
              > (in a single file) to any machine one wants.
              > junja


              AutoHotkey is a great program; I use it too. But Alex was talking
              about modifying path names within shortcuts icons, so that the icons
              work again when clicked, not (only) about setting up shortcut keys, so
              that proper actions take place for proper keystrokes.

              Of course it is true that with enough shortcut keys defined (if you
              can remember them all), that you might be able to do without the
              icons, but I don't think that is the goal for this topic.
            • Axel Berger
              ... Question: Is that really necessary and worth the effort? When I hit that problem after some reorgansition or other Windows will try to look for the moved
              Message 6 of 7 , Sep 30, 2007
              • 0 Attachment
                notetab_is_great wrote:
                > But Alex was talking about modifying path names within shortcuts
                > icons, so that the icons work again when clicked,

                Question:
                Is that really necessary and worth the effort?
                When I hit that problem after some reorgansition or other Windows will
                try to look for the moved program itself and often succeeds, if not, or
                if you don't like waiting, there is a "browse for it" on offer. And you
                only have to do that once for very program. I would not bother about
                setting something up for that.

                Another problem alex does not have, but someone else might: If you move
                a program folder a lot registry entries will point the wrong way way.
                One solution is exporting the complete registry, doing a text replace
                and importing it back in. Onother is the very nice program "jv16 power
                tools" for all kinds of registry corrections.
                NB: I found my version 1.5 to work better than the update and reverted.
                The function I use most frequently is the "registry cleaner". Beware:
                Using it for the first time, the number of duff entries might be
                staggering, and if you, like me, prefer to take a look at each one
                before deleting them in bulk, (some nay well be corrigible) be prepared
                to spend quite some time.

                Axel
              • buralex@gmail.com
                Axel Berger said on Sep 30, 2007 3:36 -0400 (in ... Point taken on alternate methods to handle my LNK problem. The first time I did it I
                Message 7 of 7 , Sep 30, 2007
                • 0 Attachment
                  Axel Berger <Axel-Berger@...> said on Sep 30, 2007 3:36 -0400 (in
                  part):
                  > Question:
                  > Is that really necessary and worth the effort?
                  > When I hit that problem after some reorgansition or other Windows will
                  > try to look for the moved program itself and often succeeds, if not, or
                  > if you don't like waiting, there is a "browse for it" on offer. And you
                  > only have to do that once for very program. I would not bother about
                  > setting something up for that.
                  Point taken on alternate methods to handle my LNK problem. The first
                  time I did it I put all the shortcuts and EXE's from my "oldsys" on a
                  second laptop and used COA2 (from PCMag) to change the shortcuts there
                  and then brought them back and replaced the original shortcuts.

                  The reason I have to do it again is that I accidentally blew away these
                  painfully rebuilt shortcuts when I set up a Junction so I could have the
                  set of shortcuts available in three places (Favorites, QuickLaunch, and
                  there original location) then tried to delete the Quick Launch version -
                  suddenly realized that they were being removed from all three
                  "locations". (still not having fully learned my lesson about the need to
                  backup fully)

                  Regards ... Alec -- buralex-gmail
                  --



                  [Non-text portions of this message have been removed]
                Your message has been successfully submitted and would be delivered to recipients shortly.