Page 1 of 1
Copy file-bytesize to command-line
Posted: 2008-09-26, 20:16 UTC
by Ulf
Is there any way to retrieve the bytesize of a file, much in the way one can use Ctrl+Enter to get a file name and Ctrl+Shift+Enter to get the file path?
If not, is there some addon for it?
If no addon, is it hard to create such an addon and bind it to some shortkey?
I am often in need of copying the bytesize of a certain file to the Windows clipboard.
Posted: 2008-09-26, 21:29 UTC
by Flint
Ulf
No, there is no simple build-in way of copying the size. However, you can use the command cm_CopyFileDetailsToClip to copy all the file details (including size) into clipboard. Actually, it's possible to write a script to extract this size only, but I'm not a script expert…
Posted: 2008-09-26, 22:56 UTC
by Stefan2
Hi Ulf, welcome to the forum.
Work around 1.)
Windows standard Alt+Enter on file opens properties dialog
from where you can select and Ctrl+C the file size
Work around 2.)
Or open DOS-Box in current dir, select and copy the file size
Work around 3.)
Button or user command:
%comspec% /c
FOR %%I IN (%N) DO @echo %%~zI |
cb
Download
CB f.ex. from
http://www.autohotkey.com/wiki/index.php?title=Command_Line_Utilities
and put it in your path.
HTH?
Thanks to sheepdog for various 'for' lessons
Posted: 2008-09-27, 18:22 UTC
by Ulf
Hello and thanks for the feedback!
The cm_CopyFileDetailsToClip command seems like a good way forward.
You mentioned there is a possibility to script the extraction of the filesize only. How do I proceed?
Maybe I could request a cm_CopyFileBytesizeToClip?
Regards,
Ulf, Sweden
Posted: 2008-09-27, 21:39 UTC
by Hacker
Ulf,
AHK script:
Code: Select all
#IfWinActive, ahk_class TTOTAL_CMD
^+s::
Clipboard =
PostMessage, 1075, 2018
ClipWait
FileGetSize, Size, %Clipboard%
Clipboard = %Size%
Size =
Return
Activates with Ctrl-Shift-S.
HTH
Roman