Author Topic: Copying a template folder with shortcuts  (Read 17509 times)

Nolly

  • Newbie
  • *
  • Posts: 8
    • View Profile
Copying a template folder with shortcuts
« on: May 25, 2016, 10:18:03 »
I have a project template folder with subfolders, template files and shortcuts (pointing to different paths in the template folder)

Every time I start a new project I copy the template folder to a new path and rename it to the new project name. Problem is, as you sure can imagine, that all the shortcuts in the new project folder points back to the template folder.

- Does Multi Commander have a feature to solve this issue?
« Last Edit: May 25, 2016, 12:51:19 by Nolly »

AlanJB

  • VIP Member
  • *****
  • Posts: 436
  • VERY old Programmer
    • View Profile
Re: Copying a template folder with shortcuts
« Reply #1 on: May 25, 2016, 17:57:53 »
I don't imagine any File Commander on the planet could cope with that scenario!

As a programmer of very long standing, I understand the need for templates, but can I ask why the shortcuts?  Which application uses these templates - or the shortcuts?  How many are we talking about?

I'm guessing there may a better way to accomplish what you need here.  You could, for example, copy the folder/file structure and then use VBScript or Powershell or a free tool like XXMLink to create all your shortcuts in the new structure.

Nolly

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Copying a template folder with shortcuts
« Reply #2 on: May 26, 2016, 09:54:12 »
Quote
I don't imagine any File Commander on the planet could cope with that scenario!
- Ok, thats a pity. I have seen that MC has a lot of options when copying files so I had hoped that one of them would work for my scenario.

Quote
(...), but can I ask why the shortcuts?  Which application uses these templates - or the shortcuts?  How many are we talking about?
- I work in a small team where we have to organize the "file flow" so all co-workers know where to find everything. Shortcuts make this a lot easier for everyone. Some of them, myself included, use CAD-application for the projects. Everyone has its own work-folder, but some of the files do we have to share.  The CAD-application allways start in the work-folder when we are opening/saving a new file. So having a shortcut in each work-folder pointing to all the different "shared" folders (10+ different folders, on different locations in the project folder) is a real time-saver.

(Small) Example:
Code: [Select]
D:\Projectnr_12345\CAD-drawings\Workfolder - Bob
D:\Projectnr_12345\CAD-drawings\Workfolder - Bob\Exref-shortcut.lnk
D:\Projectnr_12345\CAD-drawings\Workfolder - Bob\recources-shortcut.lnk
D:\Projectnr_12345\CAD-drawings\Workfolder - Bob\templates-shortcut.lnk
D:\Projectnr_12345\CAD-drawings\Workfolder - Bob\Old versions-shortcut.lnk
 <all shortcuts with same name pionts to same path>
D:\Projectnr_12345\CAD-drawings\Workfolder - Ed
D:\Projectnr_12345\CAD-drawings\Workfolder - Ed\Exref-shortcut.lnk
D:\Projectnr_12345\CAD-drawings\Workfolder - Ed\recources-shortcut.lnk
D:\Projectnr_12345\CAD-drawings\Workfolder - Ed\templates-shortcut.lnk
D:\Projectnr_12345\CAD-drawings\Workfolder - Ed\Old versions-shortcut.lnk
 
This is not a huge issue, but it's really time-consuming to re-make these shortcuts manually for every new project.

Quote
You could, for example, copy the folder/file structure and then use VBScript or Powershell or a free tool like XXMLink to create all your shortcuts in the new structure.
- That could work, but I have no knowledge of how I should set up a script to make this.
« Last Edit: May 26, 2016, 10:53:51 by Nolly »

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Copying a template folder with shortcuts
« Reply #3 on: May 26, 2016, 10:24:47 »
Yes AlanJB is right.  it is a very special case. and there is not any support for automatically modifying shortcuts.

However MC can create shortcut, and it can be done from script, It might be possible to create a script that do it
http://multicommander.com/docs/customcommands_list#mc.utils.createlink

But it depends on what option in the shortcut you change..





Nolly

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Copying a template folder with shortcuts
« Reply #4 on: June 03, 2016, 09:26:30 »
Thank you for the reply.

The only thing in the shortcut that needs to change is two path-names.

D:\Template_Folder\CAD-drawings\Workfolder - Bob\templates-shortcut.lnk
Should change to
D:\Projectnr_12345\CAD-drawings\Workfolder - Bob\templates-shortcut.lnk

And the folder "Projectnr_12345" is the only name that changes in all the different shortcuts for every new project

I have no knowledge in making scripts, so I need help in making one if that would be a solution for my case  ;D

AlanJB

  • VIP Member
  • *****
  • Posts: 436
  • VERY old Programmer
    • View Profile
Re: Copying a template folder with shortcuts
« Reply #5 on: June 03, 2016, 09:57:52 »
Sounds like the perfect opportunity to learn some Multi Script  ;)

It's not that difficult, and as a recent adopter of Multi Commander, I promise you the results are worth the effort.

Nolly

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Copying a template folder with shortcuts
« Reply #6 on: June 06, 2016, 08:08:46 »
Quote
Sounds like the perfect opportunity to learn some Multi Script  ;)
AlanJB,
Do you have a website you would recommend for looking into this? (I have no knowledge about this at all)

AlanJB

  • VIP Member
  • *****
  • Posts: 436
  • VERY old Programmer
    • View Profile
Re: Copying a template folder with shortcuts
« Reply #7 on: June 06, 2016, 09:36:12 »
Nolly,

all the information you need is here:

  http://multicommander.com/docs/UDC_multiscript (follow the links).

Help is always on hand in this and the 'Scripts' forum, especially with folk like Jungle and Mathias (the inventor of Multiscript) contributing :)

Alan

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Copying a template folder with shortcuts
« Reply #8 on: June 06, 2016, 13:12:00 »
You can not EDIT/MODIFY existing shortcut with MC and its script

But you can create new shortcuts.

With the customcommand MC.Utils.CreateLink you can create new links, (And it might work as long as you do not need to set special options inside the shortcut)
http://multicommander.com/docs/customcommands_list#mc.utils.createlink

MC.Utils.CreateLink LNKSRC="path to where link should be created"  LNKTRG="path to the file that the link should link to" LNKTYPE=4

Something like.
Code: [Select]
MC.Utils.CreateLink LNKSRC="${sourcepath}MyShortcut.lnk"  LNKTRG="C:\Program\MyFile.exe" LNKTYPE=4

Nolly

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Copying a template folder with shortcuts
« Reply #9 on: June 07, 2016, 13:11:47 »
Thank you, that ${sourcepath} entry works perfectly!

But I have so far just managed to make a command for one shortcut. How can I generate multiple shortcuts within the same User Defined Command?
(If I have more than one MC.Utils.CreateLink in the command window, it just uses the first command)

AlanJB

  • VIP Member
  • *****
  • Posts: 436
  • VERY old Programmer
    • View Profile
Re: Copying a template folder with shortcuts
« Reply #10 on: June 07, 2016, 14:57:24 »
Sounds like you are using a Custom Command (which can be only a one-line command).

You need Multi Script to issue a sequence of commands.

Which is why I said
Quote
Sounds like the perfect opportunity to learn some Multi Script  ;)