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

Author Topic: Make variable shortcut in windows explorer  (Read 11173 times)

0 Members and 1 Guest are viewing this topic.

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Make variable shortcut in windows explorer
« Reply #15 on: May 10, 2017, 06:14:55 PM »
Some more information found.
Thee is an utility called 'mkshortcut.exe' and is available.
Link:
http://www.mediafire.com/file/gzkgthmjhyv/mkshortcut.zip

Quote
D:\BIN>mkshortcut /?
Creates a shortcut with advanced properties for use by Window 7's new Taskbar.

mkshortcut -output <filename> -target <filename> [-parameters <parameters>]
        [-workingdir <directory>] [-appid <string>] [-relaunchcmd <command>]
        [-relaunchname <name>]

-output <filename>            Where to save the shortcut.
-target <filename>            Target of the newly created shortcut, not
                              necessarily an executable: files will be opened
                              by the program associated with their extensions.
-parameters <parameters>      Parameters to be passed to the shortcut's target.
                              Wrap all of them in a single pair of quotes if
                              passing multiple switches.
-workingdir <pathname>        Working directory used by the target program.
-appid <string>               String used by Windows 7's Taskbar to identify
                              applications.
-relaunchcommand <command>    Command to be used when relaunching this shortcut
                              using Windows 7's Taskbar, whether through Middle
                              Click/Shift+Click, or after being pinned.
-relaunchname <string>        User-friendly name displayed for the relaunch
                              command.
                              You may use a translatable resource by preceding
                              its name with an '@' character.

The following is only meaningful if you are using Windows 7 (or newer).


The ApplicationUserModelID (AppID in short), controls grouping of different
windows in the taskbar. Windows sharing a common AppID (inherited from a
process-wide value by default) are grouped together.

I have not tested this.

Roely

    Topic Starter


    Rookie
    • Experience: Familiar
    • OS: Windows 7
    Re: Make variable shortcut in windows explorer
    « Reply #16 on: May 15, 2017, 02:40:41 AM »
    Is that hard to do? Os it time-consuming? How much time would yuo save it you had a software tool  that does it for you?
    If you had a software tool that did that, how would it work? Describe is plain English, not symbols. Does each project have a unique name?
    Is the shortcut only a link to a folder location? Or is it sometimes a link to a file?

    How many projects are active at one time? Do you ever re-use project names?
    Q: Is that hard to do?
    A: No, making a shortcut is easy. Only you can have the problem you forget to make it, you don't make it right, you misplace it...

    Q: Os it time-consuming?
    A: For one project I need several shortcuts. I will do it faster than others, so let's say an average of 2 minutes.

    Q: How much time would yuo save it you had a software tool  that does it for you?
    A: 2 minutes per project

    Q: If you had a software tool that did that, how would it work?
    A: As user you shouldn't see any differences comparing to a normal shortcut. Click it, and that takes you to the right folder.

    Q: Describe is plain English, not symbols. Does each project have a unique name?
    A: Each project has a unique number. No symbols, no letters

    Q: Is the shortcut only a link to a folder location? Or is it sometimes a link to a file?
    A: Yes, not to files, just to folders. Always the same folder, but every time in a different project.

    Q: How many projects are active at one time?
    A: We have +/- 750 projects every year

    Q: Do you ever re-use project names?
    A: No, it's always a new unique name (number)


    I hoped there maybe was a relative easy solution for the problem. For what I hear now, it seems to be impossible or maybe with loads of work.
    ____________

    To be sure you get the point of my question, I'll try to clear it one more time, but short and simple (I hope):

    You have a template folder '100' with 2 subfolders 'A' and 'B'.
    In subfolder 'A' there's a shortcut to subfolder 'B'

    If I copy the the main folder and rename that to '200', the shortcut from subfolder 'A' to 'B' will be broken.
    Is it possible to solve that, without manually changing this every time?

    ____________

    Thank you Geek-9pm! I will definitely take a look and try it!

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Make variable shortcut in windows explorer
    « Reply #17 on: May 15, 2017, 12:43:05 PM »
    EDIT:
    Ignore this. I am having a senior moment. I somehow got to thining you were using the command line.

    You said:
    Quote
    You have a template folder '100' with 2 subfolders 'A' and 'B'.
    In subfolder 'A' there's a shortcut to subfolder 'B'

    If I copy the the main folder and rename that to '200', the shortcut from subfolder 'A' to 'B' will be broken.
    Is it possible to solve that, without manually changing this every time?
    Exactly!  A Windows shortcut is always absolute reference that sticks to the original item.  **
    What you want is a relative link to a directory in a relative potion.
    The CD  (change directory) command can be either absolute or relative and might be what you want. Of course, CD can only change folders. It can not start a program.
    CD only works at the command line.

    ** But others have found a workaround for this.

    How to create a shortcut with relative path

    Also:
    https://www.sevenforums.com/tutorials/400257-shortcut-create-relative-path.html
    Both of these seem to be more trouble that it is worth.

    Here is some information about the CD command.
    https://www.computerhope.com/jargon/c/cd.htm
    Quote
    CD (Change Directory) is a command used to switch directories in MS-DOS and the Windows command line.
    Some examples:
    cd\                ... go to root
    cd..                .. go back one level
    cd /d e:\pics   ... go to pics on e: but don't change position of current drive.
    cd ..\job2       ... go one and find the job2 directory

    A batch program sound contain the relative path to find a nearby directory.
    By using only relative paths, the batch file only needs to be available on the current path.
    That means only only batch file is needs to
    -switch to Project B\relative while in Project A\relative.
    SEE-B.bat
    Code: [Select]
    CD ..\ProjectBIf you were in D:\jogs\DoctorJones\ProjectA
    It will flip you  to:D:\jogs\DoctorJones\ProjectB

    Still I do not understand if the user works with the commend line or i he uses the graphical display. CD command is  only for command line.
    I hope this might be of some help.  :)
    « Last Edit: May 15, 2017, 01:17:29 PM by Geek-9pm »

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Make variable shortcut in windows explorer
    « Reply #18 on: May 15, 2017, 02:28:50 PM »
    This is from dictation.
    After getting some more thought to this, what you really want is the utility called startup.exe to create a set of Windows links when you create a new project for a client.
    I assume you already have some kind of script or batch file that creates folders and populates the folders with basic information about how you work on a certain kind of project. The only item that is variable would be the client's name. All the items inside the project would have standard name did you use for the kind of work you do. So some kind of script file is what you are using to create a new project directory and populated with some stuff that is peculiar to your kind of work. The top folder apparently would be either the client's name or some kind of tag that references the client's name in a database.
    Now that, the program utility called shortcut.exe would be used during the new project creation process to create the suitable links needed to all the relevant folders inside of the project. Of course, Windows links have to be absolute paths, with only a few exceptions for some of these system things.
    Using a suitable script or batch program you can invoke the shortcut.exe program and give it the absolute parameters that is needed to create each shortcut. The script or batch program that you're using will be able to create the absolute paths based on the information you have provided at the beginning of a new project.
    You might give a figure this out for yourself, or perhaps somebody else here wants to give you help with the syntax of the shortcut.exe program. The one I think you want is known as version 1.11. Here is a copy of the output from the command prompt when asking for help with the shortcut.exe program.
    End of dictation.
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
       
    Shortcut.exe
    S:\>shortcut

    Shortcut [Version 1.11]
    Creates, modifies or queries Windows shell links (shortcuts)

    The syntax of this command is:

    shortcut /F:filename /A:C|E|Q [/T:target] [/P:parameters] [/W:workingdir]
             [/R:runstyle] [/I:icon,index] [/H:hotkey] [/D:description]

     /F:filename    : Specifies the .LNK shortcut file.
     /A:action      : Defines the action to take (C=Create, E=Edit or Q=Query).
     /T:target      : Defines the target path and file name the shortcut points to
     /P:parameters  : Defines the command-line parameters to pass to the target.
     /W:working dir : Defines the working directory the target starts with.
     /R:run style   : Defines the window state (1=Normal, 3=Max, 7=Min).
     /I:icon,index  : Defines the icon and optional index (file.exe or file.exe,0)
     /H:hotkey      : Defines the hotkey, a numeric value of the keyboard shortcut
     /D:description : Defines the description (or comment) for the shortcut.

     Notes:
     - Any argument that contains spaces must be enclosed in "double quotes".
     - If Query is specified (/A:Q), all arguments except /F: are ignored.
     - To find the numeric hotkey value, use Explorer to set a hotkey and then /A:
     - To prevent an environment variable from being expanded until the shortcut
       is launched, use the ^ carat escape character like this: ^%WINDIR^%

     Examples:
       /f:"%ALLUSERSPROFILE%\Start Menu\Programs\My App.lnk" /a:q
       /f:"%USERPROFILE%\Desktop\Notepad.lnk" /a:c /t:^%WINDIR^%\Notepad.exe /h:84
       /f:"%USERPROFILE%\Desktop\Notepad.lnk" /a:e /p:C:\Setup.log /r:3

     An argument of /? or -? displays this syntax and returns 1.
     A successful completion will return 0.

     Copyright 2000-2005 Marty List, www.OptimumX.com

    S:\>

    http://www.optimumx.com/downloads.html
    That is the best I can do for you.  :)

    Roely

      Topic Starter


      Rookie
      • Experience: Familiar
      • OS: Windows 7
      Re: Make variable shortcut in windows explorer
      « Reply #19 on: May 16, 2017, 06:09:38 AM »
      Waaah!
      Option 2 of this website you gave, did the trick for me!
      https://www.sevenforums.com/tutorials/400257-shortcut-create-relative-path.html

      For now it looks good... I'll test it a bit more, but, for now, it looks perfect for me!

      Thank you, thank you, thank you!

       (| (|

      Computer CPR



        Beginner

        Thanked: 2
        • Computer CPR
      • Experience: Beginner
      • OS: Windows 7
      Re: Make variable shortcut in windows explorer
      « Reply #20 on: May 16, 2017, 11:50:07 AM »
      Glad I found this!  I was looking for some sample code similar to this for something I am working on!

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Make variable shortcut in windows explorer
      « Reply #21 on: May 16, 2017, 12:08:22 PM »
      Glad you found something!
      Perhaps the title to this thread ought to be:
      How to Create Shortcut with Relative Path
      Using that as a key phrase, you can Bing or Google for forums that consider this problem. As mentioned, relative shortcuts are the norm in HTML, but not Windows. A relative shortcut is a powerful tool, if you can get  it.

      The widows forum mentioned by Roely recommends:
          Option One: Using a Symbolic Link
          Option Two: Using a Shortcut of Window Explorer
          Option Three: Using a Batch File
          Option Four: Using a Visual Basic Script
      Again, that Link:
      https://www.sevenforums.com/tutorials/400257-shortcut-create-relative-path.html
      I admit, this is very deep stuff for me.  :-[

      Roely

        Topic Starter


        Rookie
        • Experience: Familiar
        • OS: Windows 7
        Re: Make variable shortcut in windows explorer
        « Reply #22 on: May 17, 2017, 02:17:00 AM »
        Glad you found something!
        Perhaps the title to this thread ought to be:
        How to Create Shortcut with Relative Path
        Using that as a key phrase, you can Bing or Google for forums that consider this problem. As mentioned, relative shortcuts are the norm in HTML, but not Windows. A relative shortcut is a powerful tool, if you can get  it.
        Yes, sorry... I didn't know how to name the problem. That's probably why I couldn't find a good solution.

        Glad this topic could already help another user. :)
        We're very thankful for you're effort and time!