Can you make .lnk file date same as its target
Moderators: Hacker, petermad, Stefan2, white
Can you make .lnk file date same as its target
TC can do multiple .lnk files from selected files by Ctrl+Shift+F5, but their datestamps are the date and time of making the links. I could not find a way in TC or its plugins how to reflect in .lnk files the date of their target files. Can anyone suggest a way, either in TC, or through any other programs to achieve this?
Tried. That requires me to change each of file date manually to match the date of the target file. I need to make thousands of .lnk files for classifying docs to different organizational folders, but they do not reflect the datestamps of the target files. I was looking for some help on how to automate the process. Thanks in anticipation.
sorcar,
Just say the word
Create CreateLinksKeepingTimestamps.ahk with the above contents, add to Button Bar, set
as the parameters, select source files, click button and links to the source files will be created in the target dir having their timestamps adjusted automatically.
HTH
Roman
Just say the word

Code: Select all
Loop, Read, %1%
{
SplitPath, A_LoopReadLine, FileName
FileGetTime, TimeStamp, %A_LoopReadLine%
FileCreateShortcut, %A_LoopReadLine%, %2%%FileName%.lnk
FileSetTime, %TimeStamp%, %2%%FileName%.lnk
}
Code: Select all
"%L" "%T\"
HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
sorcar,
Welcome.
You can also create a user command that would call this script and assign it to a keyboard shortcut such as Ctrl-Shift-F5, overriding the default TC shortcut to create links.
HTH
Roman
Welcome.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
sorcar,
TC does that, too.
Here is the adjusted code:
HTH
Roman
TC does that, too.

Code: Select all
Loop, Read, %1%
{
SplitPath, A_LoopReadLine, , , , FileName
FileGetTime, TimeStamp, %A_LoopReadLine%
FileCreateShortcut, %A_LoopReadLine%, %2%%FileName%.lnk
FileSetTime, %TimeStamp%, %2%%FileName%.lnk
}
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
.lnk files for selected files and files within selected dirs
Additional feature request [after almost 3 years]:
The ahk code above makes shortcuts for selected files - but does not include files within selected folders. Can someone show how to make shortcuts of all selected files, including those inside selected directories (recursively)?
Thanks in advance.
The ahk code above makes shortcuts for selected files - but does not include files within selected folders. Can someone show how to make shortcuts of all selected files, including those inside selected directories (recursively)?
Thanks in advance.
sorcar,
Like this?
HTH
Roman
Like this?
Code: Select all
Loop, Read, %1%
{
FileGetAttrib, Attrib, %A_LoopReadLine%
IfInString, Attrib, D
{
Loop, Files, %A_LoopReadLine%*.*, R
{
SplitPath, A_LoopFileLongPath, , , , FileName
FileGetTime, TimeStamp, %A_LoopFileLongPath%
FileCreateShortcut, %A_LoopFileLongPath%, %2%%FileName%.lnk
FileSetTime, %TimeStamp%, %2%%FileName%.lnk
}
Continue
}
SplitPath, A_LoopReadLine, , , , FileName
FileGetTime, TimeStamp, %A_LoopReadLine%
FileCreateShortcut, %A_LoopReadLine%, %2%%FileName%.lnk
FileSetTime, %TimeStamp%, %2%%FileName%.lnk
}
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.