AutoHotkey Community

It is currently May 27th, 2012, 12:06 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: February 19th, 2011, 10:42 pm 
Offline

Joined: June 1st, 2007, 2:00 pm
Posts: 180
Copying windows shortcuts

I use many times shortcuts under windows xp for not duplicating the space and control only one original file.

I put this windows shorcut in a folder about a task or similar when i need. Even shortcuts to another folders.

But when I want share this information to a usb, cd, dvd, external drive, etc, I would like to share the original file.

So I would like a program to copy instead of the shortcut the original file.

Do you know anyone ?

Best Regards


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 9th, 2011, 3:37 am 
Interesting concept, AutoPepe.
Very interesting.
If one could give me a regex to isolate the raw section
(...)\\WINXP_SP3\C TMP\test\Report.htm(...)*
and transform it into
C:\TMP\test\Report.htm
I believe I could build an XYplorer script for you (totally new to AHK, sorry!) which does the job.

*larger portion:
 ¹ ±  WINXP_SP3 C:\ $    \\WINXP_SP3\C TMP\test\Report.htm  . . \ R e p o r t . h t m


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2011, 12:03 pm 
Well... since had no answer, had to take another approach on this.
This is basically an XYplorer script that will check in loco each and every file, assuming you started its execution having previously selected on current pane a bunch of *.lnk files. It'll do nothing in case of other files being selected, just proceed ignoring them.
I'll monitor this thread for a few days so if you have any questions, just write them.
Minor issues - it'll pop a system dialog in presence of non-existing target files (it could be avoided if I had the assistance of a regex-wise user); the lousy forth-and-back method to verify each linked file (ditto on first note).
Requires XYplorer 9.90.0402+ to run (it does the version check at starting).

Hope this helps.

Code:
//it will pop a message for each non-existing target file!

   end(compare("<xyver>", '9.90.0402', 'v') < 0, "This script was tested on XYplorer v9.90.0402.<crlf>Script will now be shut.");
   end(getinfo("CountSelected") < 1), "At least one file must be selected on current pane.";
   $el1 = GetInfo("CountSelected");
   #217; //clear clipboard - PRIOR to foreach!!!

   $sfiles = get(selecteditemsnames, "|");
      foreach($file, $sfiles)

      {

   selfilter """$file""";
   $strt = <curpath>;

   $tst1 = regexreplace($file, "(.*)\.(.*)", "$2");
   IF ($tst1 == lnk)
      {
   #1048;
   #1046; //go to focused .lnk target file

   $tst = <curext>;
   IF ($tst == lnk) { focus; backupto "<curpath>\_Broken", "<curitem>", 4; }
   ELSEIF ($tst != lnk) { focus; copytext "<curitem>" . "|", a; }
   goto $strt;
      }

   ELSEIF ($tst1 != lnk) {   }

      }

   backupto "<curpath>\_BKP", "<clipboard>", 4;
   goto "$strt\_BKP";
   selectitems "<clipboard>";
   $el2 = GetInfo("CountSelected");

   goto "$strt\_Broken";

   selfilter "*lnk";
   $el3 = GetInfo("CountSelected");
   $broken = get(selecteditemsnames, "<crlf>");
   goto $strt;
   selectitems "$broken";

   text "$el1 - Number of starting links;<crlf>$el2 - Number of actually copied files.<crlf>*in case of collision with any previously existing file,<crlf>numbers will be suffixed to copies.<crlf><crlf>$el3 broken links:<crlf>$broken<crlf>*if any previously existing '.lnk' was present in the '_Broken' folder,<crlf>it will be listed too.<crlf><crlf>Have fun!", 600, 400, "Report", w;


Report this post
Top
  
Reply with quote  
PostPosted: March 19th, 2011, 8:16 pm 
In NTFS file system you can maintain two copiesof the same file in different folders, in fact they are only one, thus making changes to anyone changes the "other". Also you save disk space are the data is only one.

These are called "hard links", they are very usefull for example to organize photos in different folders withouth duplicating storage


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group