Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

FileGet/Set or FileGetProperties


  • Please log in to reply
28 replies to this topic
toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
As I'm researching to get the comments from the file properties, I came by this request on the todo list.

New command FileGet/Set or FileGetProperties to retrieve and set things from a file's property sheet (title, author, permissions, etc.)


Any chance to increase priority and get this feature anytime soon?
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
It probably won't happen soon because it's unfamiliar territory for me, and thus requires more R&D. Maybe there's some way to do it with DllCall.

freakkk as guest
  • Guests
  • Last active:
  • Joined: --
I know you were looking to get comments/author-- but if you need to get/set permissions- you can you use cacls..

C:\>cacls
Displays or modifies access control lists (ACLs) of files

CACLS filename [/T] [/E] [/C] [/G user] [/R user [...]] [/P user]] [/D user [...]]
filename Displays ACLs.
/T Changes ACLs of specified files in the current directory and all subdirectories.
/E Edit ACL instead of replacing it.
/C Continue on access denied errors.
/G user:perm Grant specified user access rights. Perm can be: R Read W Write C Change (write) F Full control
/R user Revoke specified user's access rights (only valid with /E).
/P user:perm Replace specified user's access rights. Perm can be: N None R Read W Write C Change (write) F Full control
/D user Deny specified user access.



Serenity
  • Members
  • 1271 posts
  • Last active:
  • Joined: 07 Nov 2004
I'd like to be able to read/write file metadata (eg. fields in the File Properties/Summary tab) with AutoHotkey.
"Anything worth doing is worth doing slowly." - Mae West
Posted Image

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
This has been requested in other topics too. What would help is a demo script that achieve it via DllCall so we can learn from someone how to do it :).

But in case no one knows how to do it, it's still on the to-do list to do some R&D .

shimanov
  • Members
  • 610 posts
  • Last active: Jul 18 2006 08:35 PM
  • Joined: 25 Sep 2005
There seems to be two [documented] methods for accessing the data stored in an NTFS file stream:

CreateFile( "d:\\unknown.bin:DocumentSummaryInformation:$DATA", FILE_ALL_ACCESS, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 )
...
ReadFile( h_file, buffer, buffer_size, &buffer_actual, 0 )

or

; load all streams, attributes, etc.
BackupRead( h_file, (BYTE*) buffer, buffer_size, &buffer_actual, false, false, &context )

However, I have not located a reference to specify the format of the retrieved data. Technically, it can contain any kind of content. The standard "Summary" properties seem to be stored in a database format (i.e., header, records, data), which can be interpreted through heuristic means -- assuming it is the same across Windows platforms.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
That's a great starting point. Thanks for posting it.

shimanov
  • Members
  • 610 posts
  • Last active: Jul 18 2006 08:35 PM
  • Joined: 25 Sep 2005

That's a great starting point. Thanks for posting it.


Sure.

To clarify. The character between "bin:" and "Document" is ASCII code 0x5, not a pipe (|) character.

kinda_lost
  • Guests
  • Last active:
  • Joined: --
Hi..Found this thread while searching forum...i also would like to set a file's metadata w/ ahk.

Reason: I use iTunes which displays info based on the metadata of a song file. I'd like to use AHK to rename all the info in the file's properties (properites>>summary>>advanced)

Any progress with this yet? still on Do-to-list, or has this already been accomplished?

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
It's still on the to-do list. Shimanov's post above will probably be helpful when the time comes. If anyone wants to continue the research, perhaps you can use that info.

raven-gm
  • Members
  • 44 posts
  • Last active: Nov 20 2011 09:40 AM
  • Joined: 25 Mar 2007
I could really use this command...
I don't have much programming experience (mostly actionscript, ahk, and ti-92), but is there any way I could do some sort of data collection project on this for someone who actually knows what they're doing?
I would like to think that I know what I'm doing, but there's just to much stuff I've yet to learn...

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
This can be done via COM and IPropertyStorage interface.

Reference
http://msdn2.microso...y/aa379968.aspx


Maybe somebody of "COM programmers" can give ya a hand.

This can also be handy
http://mail.python.o... ... 01107.html
Posted Image

Tekl
  • Members
  • 814 posts
  • Last active: May 03 2009 03:28 PM
  • Joined: 24 Sep 2004
Any news on how to set access rights with AHK?

CACLS is no solution as it is language dependent: http://www.autohotke... ... datacommon
Tekl

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
I am sure it can be done via COM
You should search VB scripts as those contain the largest number of such examples.
Posted Image

Tekl
  • Members
  • 814 posts
  • Last active: May 03 2009 03:28 PM
  • Joined: 24 Sep 2004
I don't want to use VB Scripts or have I missed the AHK supports COM?
Tekl