Welcome Guest.   Make a donation to an author on the site August 01, 2014, 06:55:05 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Learn about the DonationCoder.com microdonation system (DonationCredits).
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1] 2 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Windows Shortcut transformation  (Read 10139 times)
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« on: February 20, 2011, 02:00:09 AM »

Windows Shortcut transformation.



I would like a script to click over a file shortcut and replace him with the real file.

I would like a script to click over a folder shorcut and replace him with the real folder.

Best Regards
Logged
Ath
Supporting Member
**
Posts: 2,186



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: February 20, 2011, 05:22:37 AM »

Do the suggestions at your original question-thread work for you?
Logged

Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #2 on: February 20, 2011, 07:31:26 AM »

I'll try and comment everywhere.

 Kiss
Logged
4wd
Supporting Member
**
Posts: 3,271



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: February 20, 2011, 09:25:12 PM »

Short2Real - Select a source directory and then select a destination - that's it.

It won't overwrite anything but it also doesn't check to see if the copy was successful, that said it seemed to work OK in my limited testing.

Formatted for AutoIt with the GeSHI Syntax Highlighter [copy or print]
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_UseUpx=n
  3. #AutoIt3Wrapper_UseX64=n
  4. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  5. ; Short2Real.au3
  6.  
  7. $src = FileSelectFolder('Select source directory:', '', 7)
  8. $dest = FileSelectFolder('Select destination directory:', '', 7)
  9.  
  10. $scut = FileFindFirstFile($src & "\*.lnk")
  11. If $scut = -1 Then
  12.    MsgBox(64, "Short2Real", "No shortcuts found.")
  13.    Exit
  14.  
  15.    $file = FileFindNextFile($scut)
  16. $details = FileGetShortcut($src & '\' & $file)
  17.  
  18. If StringInStr(FileGetAttrib($details[0]), 'D', 1) > 0 Then
  19. DirCopy($details[0], $dest & '\' & StringLeft($file, StringLen($file) - 4), 0)
  20. FileCopy($details[0], $dest, 0)
  21. FileClose($scut)
  22.  
  23. MsgBox(64, 'Short2Real', 'Finished')

Above is superceeded, see here.
« Last Edit: March 30, 2011, 11:15:22 PM by 4wd » Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #4 on: February 21, 2011, 01:19:00 AM »

Nice name program indeed  Kiss

I'll try and test completely. I am very interested in this application.

Best Regards
 tongue
Logged
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #5 on: February 21, 2011, 05:35:04 AM »

First proofs great.

Now I need a program to reproduce the folder structure. Copy the directory structure of the original folder. I think i've seen or have something like that. I will comment.

I observed the behaviour of this wonderful program : short2real , and the initial folder only contains other real folders, so do nothing.
Over the rest of folders acts one by one interacting with the user to transform file shortcuts and folder shortcuts to real files and real folders.

I have to test the behaviour under hard circunstances like more deeper shortcuts or cycle shortcuts.

Perhaps I can propose a better feature of this program, but from now is very useful.

Best Regards
Logged
4wd
Supporting Member
**
Posts: 3,271



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: February 21, 2011, 06:04:38 AM »

Sorry, I know English isn't your native language but I'm still having trouble following what you need to happen.

Is there any chance you could give me a sample before and after folder structure.

eg. Can you do 'dir /b /s (source path) >src.txt' and then create the destination as you wish it to look and do 'dir /b /s (dest path) >dest.txt' and then PM me the two text files ?
Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
PhilB66
Supporting Member
**
Posts: 1,510


View Profile Give some DonationCredits to this forum member
« Reply #7 on: February 21, 2011, 10:16:44 AM »

Quote
Miroirs - Makes it easy to replicate complex directory structures without copying the files within



http://www.scanialabs.com...ucts/Miroirs/Miroirs.aspx

Requires .net
Logged
tomos
Charter Member
***
Posts: 8,376



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: February 21, 2011, 11:53:41 AM »

Quote
Miroirs - Makes it easy to replicate complex directory structures without copying the files within

wasnt there a dc app/coding snack that did this as well (?)
Logged

Tom
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #9 on: February 21, 2011, 04:14:11 PM »

Sorry, I know English isn't your native language but I'm still having trouble following what you need to happen.

Is there any chance you could give me a sample before and after folder structure.

eg. Can you do 'dir /b /s (source path) >src.txt' and then create the destination as you wish it to look and do 'dir /b /s (dest path) >dest.txt' and then PM me the two text files ?

I'll try of my best. Excuse me. I'll tell you later.

Logged
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #10 on: February 21, 2011, 04:27:52 PM »

Quote
Miroirs - Makes it easy to replicate complex directory structures without copying the files within
(see attachment in previous post)
http://www.scanialabs.com...ucts/Miroirs/Miroirs.aspx

Requires .net


I don't know. I try treecopy as a portable version. But to solve the recursevely mode I think an array.
to control over the past copy shorts.

Quote
Miroirs - Makes it easy to replicate complex directory structures without copying the files within

wasnt there a dc app/coding snack that did this as well (?)

Logged
4wd
Supporting Member
**
Posts: 3,271



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #11 on: February 21, 2011, 05:36:19 PM »

Here's a version that gives you the option of recursive copying, replicating the original folder tree in the destination.  That is, the original folder tree of the directory with the shortcuts not the folder tree of the directories with the real files/folders.

Just needs a nice GUI now  DONE smiley

Now just got to find a nice icon.
« Last Edit: February 22, 2011, 07:12:04 PM by 4wd » Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #12 on: February 22, 2011, 10:14:15 AM »

 Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss Kiss



I'll test and comment. I was entering the forum for ask that exactly possibility

Best Regards
Logged
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #13 on: February 22, 2011, 10:27:14 AM »

(this is only an introduction). Your splendid codesnack is finished at the above state.
By the way. I am looking for a sort of director file with universal shortcuts or something near that.

I try to explain the best I can. In the main original folder I use by example (a document word xp) with links (hyperlinks) . I suppose i will lose those links when move the .doc document to the new folder. And obviously sure when I move the word document to a cd/dvd/usb/external hard drive.

I use from many years ago a CRM Goldmine 5.5 that have the possibility to offer alternativas paths when an original link is not found.



I don't know the exact concept behing : universal shortcut. Perhaps have other utilities like explore other hard disk when the link is not found in the first. Or a desktop shortcut tha may vary according the external disk you have connected.

When me like a little ant have to link several hundreds of linked files revised each time I move the word document is a tedious task.

Anyone knows alternatives ?

Best Regards

Logged
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #14 on: February 22, 2011, 10:36:20 AM »

Something happen



I don't reach exploring the original folder or the target folder because I can't enter en documents and settings folder.

 tongue


Important Note : I hope the lady comes to the next Carnival in Tenerife where I am from.  smiley
Logged
4wd
Supporting Member
**
Posts: 3,271



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: February 22, 2011, 03:57:58 PM »

Forgot to test it on anything other than W7 x64, I'll have a look later today.

It looks like you're using XP ?

Were you trying to get to a folder on the Desktop ?
« Last Edit: February 22, 2011, 04:01:02 PM by 4wd » Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #16 on: February 22, 2011, 05:57:19 PM »

Yesssssssssssssssssssss.

Windows xp pro sp3 .
 tongue
Logged
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #17 on: February 22, 2011, 05:58:11 PM »

I have seven in the portatil
Logged
4wd
Supporting Member
**
Posts: 3,271



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: February 22, 2011, 06:51:45 PM »

Never mind, it was because I didn't allow System or Hidden folders.

I'll put another up in a  couple of hours.

I have seven in the portatil

Is that like a porta-potty ?   tongue

There seems to be a problem with the function to display folders so it may take a little while to find it.

So in the meantime, here's the no gui version.

« Last Edit: February 23, 2011, 05:17:21 AM by 4wd » Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #19 on: February 23, 2011, 03:07:40 AM »

 smiley I'll try and comment
 tongue
Logged
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #20 on: February 23, 2011, 03:22:27 AM »

 Sad





Seems don't copy the empty folders and in other image seems don't copy well some folders.

 tongue
Logged
4wd
Supporting Member
**
Posts: 3,271



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #21 on: February 23, 2011, 04:16:26 AM »

The program only works on shortcuts, if a folder has no shortcuts in it then it won't be replicated in the destination because it was empty.

I think you might have to do what I suggested back here so I know exactly what the before and after is supposed to look like.

OK, found a bug that was turning folders into files, (kind of like wine into water Wink ), so that will fix that problem.  However, it still won't recreate folders that are empty, (no shortcut in them), because it only works on shortcuts.
« Last Edit: February 26, 2011, 09:50:08 PM by 4wd » Logged

Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum Evil
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #22 on: February 23, 2011, 10:24:46 AM »

 Grin I'll try and comments
 Kiss
Logged
rjbull
Charter Member
***
Posts: 2,737

View Profile Give some DonationCredits to this forum member
« Reply #23 on: February 23, 2011, 11:07:23 AM »

Not sure it's relevant, but just noticed this in TinyApps Blog:

Quote
Replace dupes with hard links or shortcuts

    * CloneSpy: GUI dedupe utility that can (among other things) replace duplicate files with shortcuts or hard links.
    * Dupemerge: CLI utility that searches for identical files on a logical drive and creates hard links among those files. (via Anthony Frazier)
    * Duplicate File Hard Linker (DFHL): Open source CLI tool that replaces duplicate files with hard links. Byte-per-byte comparison ensures only identical files are hard linked.
    * Finddupe: Open source CLI tool for detecting, deleting, or hard linking duplicate files. Can also list all hardlinked files on a given volume (similar to Microsoft's Hlscan.exe). Finddupe computes a hash based on the first 32k of a file, only checking entire file if there is a match.

This KB article explains hard links:

    A hard link is a folder entry for a file regardless of where the actual file data exists on that volume. Every file is considered to have at least one hard link. On NTFS volumes, each file can have multiple hard links; therefore, a single file can be displayed in many folders (or even in the same folder with different names). Because all of the links reference the same file, programs can open any of the links and modify the file. A file is deleted from the file system only after all of the links to it have been deleted. After you create a hard link, programs can use the link like any other file name. Note that Windows Explorer and a command prompt will show all linked files as being the same size, even though they all share the same data and do not actually use that amount of disk space.

This last bit can be confusing. Let's say you've got a folder with three duplicate files of 10MB each. After replacing the dupes with hard links, the folder size is still reported as 30MB by Windows Explorer and cmd.exe. However, the "Used space" reported by Windows Explorer for the volume will have decreased by 20MB.
Logged
Contro
Participant
*
Posts: 2,063

View Profile Give some DonationCredits to this forum member
« Reply #24 on: February 23, 2011, 04:08:48 PM »

I'll take a good look rjbull and comments.
 tongue
Logged
Pages: [1] 2 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.125s | Server load: 0.03 ]