Virtual Copy (create junctions and hardlinks)

Discuss and share scripts and script files...
Post Reply
fishgod
Posts: 231
Joined: 03 Feb 2008 00:40
Location: Sankt Augustin (near Bonn), Germany

Virtual Copy (create junctions and hardlinks)

Post by fishgod »

I have a new created a new version of this script.
It is now in the
> Mega ScriptsPack <

The new version depends on other scripts also contained in this package.


VirtualCopy v0.01.0001
(create junctions and hardlinks)

With this Script you can create junctions (for folders) and hardlinks (for files).

Why do you need this, as you may noticed XY can create hardlinks for files via Copy & Paste Special \ Create Hard Link(s).
But I felt not really happy with this implementation. And of cause, XY can create only hardlinks (this means files only).

How it works:
  • 1. Just select a bunch of files and/or folders.
    2. Goto another folder
    3. Choose Virtual Paste
What can be done:
The Script detects files and folders automatically. And so will create junctions for the folders and hardlinks for the files.
  • Run the Script as Menu from catalog or elsewhere
  • Directcall to the subroutine-labels (Copylabel is "get" and Pastelabel is "set")
  • Of cause you can assign CKS to UDC to have it right to your hands
:!: You can make junctions across partitions but you cannot make hardlinks across partitions.

What you need: You need to change the pathes to the tools in the script. (You can copy the tools to your system32-folder, so you don't need to specify the path)
Just search for this piece of code:

Code: Select all

  $g_junction_exe = "C:\Programme\Tools\SYSINTERNALS\junction.exe";
  $g_fsutil_exe    = "fsutil.exe"; //this is allready in system32, its shipped with windows :)
  $g_hstart_exe   = "C:\Programme\Tools\hstart.exe";
When you want to modify your version of ForEachItem you only need to do:
Replace

Code: Select all

	$common = '$FEI_item = "{Fullname}"; load "'.$FEI_file.'", "'.$FEI_name;
	// now turn the list of all selected items into a little script
	$script = 'global $FEI_item; setting "LockTree", 1; ' . (($FEI_mixed == 1) ? report($common.'Item"; ', 1) : report("$common{Dir Folder|File}""; ", 1));
with

Code: Select all

	$common = '$FEI_item = "{Fullname}";$FEI_itemname = "{Name}"; load "'.$FEI_file.'", "'.$FEI_name;
	// now turn the list of all selected items into a little script
	$script = 'global $FEI_item, $FEI_itemname; setting "LockTree", 1; ' . (($FEI_mixed == 1) ? report($common.'Item"; ', 1) : report("$common{Dir Folder|File}""; ", 1));
--
Ahh XY has me, can't stop scripting, ahh... :twisted:
You do not have the required permissions to view the files attached to this post.
Operating System: Win10 x64 / Win11 x64 / almost allways newest XY-beta
totally XYscripting-addicted

Post Reply