public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Accessing Property Sheets
@ 2004-07-29 10:37 George
  2004-07-29 18:47 ` Igor Pechtchanski
  0 siblings, 1 reply; 4+ messages in thread
From: George @ 2004-07-29 10:37 UTC (permalink / raw)
  To: cygwin

I keep running up against situations where I require access to the 
property sheet for a folder/file to perform a settings change I can't 
accomplish otherwise. 

I'm wondering whether Cygwin offers some way I've not yet discovered to 
display the property sheet dialog for a folder/file.  Seems it would 
save the trouble of opening an explorer window from bash, selecting a 
file, opening the context menu by right clicking and then selecting 
properties (before navigating the various tabs and clicking some more).

Thanks.




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Accessing Property Sheets
  2004-07-29 10:37 Accessing Property Sheets George
@ 2004-07-29 18:47 ` Igor Pechtchanski
  2004-07-30  6:53   ` George
  0 siblings, 1 reply; 4+ messages in thread
From: Igor Pechtchanski @ 2004-07-29 18:47 UTC (permalink / raw)
  To: George; +Cc: cygwin

On Wed, 28 Jul 2004, George wrote:

> I keep running up against situations where I require access to the
> property sheet for a folder/file to perform a settings change I can't
> accomplish otherwise.

Exactly which properties are you trying to change?  Some of the security
ones can be changed via setfacl, as well as chmod/chown (I don't think
either one supports setting inheritable permissions, though).

> I'm wondering whether Cygwin offers some way I've not yet discovered to
> display the property sheet dialog for a folder/file.  Seems it would
> save the trouble of opening an explorer window from bash, selecting a
> file, opening the context menu by right clicking and then selecting
> properties (before navigating the various tabs and clicking some more).

Not really Cygwin-specific, but look up the Shell API on MSDN [*] (which
you can invoke via rundll/rundll32), in particular, the SHObjectProperties
function.

To put this back on-topic, if you do manage to find a way to do what you
want that works on all OS's, please consider making a cygstart-like
utility to do this and contributing it to the Cygwin distribution.

HTH,
	Igor
[*] One of the possible pointers is
<http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/functions.asp>
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Happiness lies in being privileged to work hard for long hours in doing
whatever you think is worth doing."  -- Dr. Jubal Harshaw

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Accessing Property Sheets
  2004-07-29 18:47 ` Igor Pechtchanski
@ 2004-07-30  6:53   ` George
  0 siblings, 0 replies; 4+ messages in thread
From: George @ 2004-07-30  6:53 UTC (permalink / raw)
  To: cygwin

Igor Pechtchanski wrote:

>On Wed, 28 Jul 2004, George wrote:
>
>
>>I keep running up against situations where I require access to the
>>property sheet for a folder/file to perform a settings change I can't
>>accomplish otherwise.
>>
>
>Exactly which properties are you trying to change?  Some of the security
>ones can be changed via setfacl, as well as chmod/chown (I don't think
>either one supports setting inheritable permissions, though).
>
Setting inheritable permissions was one, but some of the folder/virtual 
folder property sheets do have settings other than permissions-related 
ones.  Also, it can sometimes be a useful (albeit back-asswords) double 
check to ensure an action performed on the command-line had the desired 
effect (sort of like using cat on a *nix system to review the contents 
of a config file after using a GUI tool to perform changes.

What inspired my question was two simple shell scripts I recently wrote 
to provide a menu-driven interface to the .cpl applets and .msc 
snap-ins.  I found the approach infinitely easier and faster to use than 
opening explorer windows, or labouring over messy changes to the 
registry on the command-line.

>
>>I'm wondering whether Cygwin offers some way I've not yet discovered to
>>display the property sheet dialog for a folder/file.  Seems it would
>>save the trouble of opening an explorer window from bash, selecting a
>>file, opening the context menu by right clicking and then selecting
>>properties (before navigating the various tabs and clicking some more).
>>
>
>Not really Cygwin-specific, but look up the Shell API on MSDN [*] (which
>you can invoke via rundll/rundll32), in particular, the SHObjectProperties
>function.
>
I did stumble across 'cygstart --reference'.  A thoughtful addition.

>
>To put this back on-topic, if you do manage to find a way to do what you
>want that works on all OS's, please consider making a cygstart-like
>utility to do this and contributing it to the Cygwin distribution.
>

Gladly.  Send me a few books on C programming and I'll get right on it. 
:-) Seriously, it looks trivial enough but I didn't know I could invoke 
those functions using rundll32 so maybe that'll take care of my 
immediate needs.  I'd like to think it would useful to others so maybe I 
will consider your suggestion and buy those books myself and see what 
comes of it.

Cheers.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Accessing Property Sheets
@ 2004-07-29 19:02 DePriest, Jason R.
  0 siblings, 0 replies; 4+ messages in thread
From: DePriest, Jason R. @ 2004-07-29 19:02 UTC (permalink / raw)
  To: cygwin

On Thursday, July 29, 2004 7:31 AM, Igor Pechtchanski wrote

> On Wed, 28 Jul 2004, George wrote:
> 
>> I keep running up against situations where I require access to the
>> property sheet for a folder/file to perform a settings change I can't
>> accomplish otherwise.
> 
> Exactly which properties are you trying to change?  Some of the
> security ones can be changed via setfacl, as well as chmod/chown (I
> don't think either one supports setting inheritable permissions,
> though). 
> 
>> I'm wondering whether Cygwin offers some way I've not yet discovered
>> to display the property sheet dialog for a folder/file.  Seems it
>> would save the trouble of opening an explorer window from bash,
>> selecting a file, opening the context menu by right clicking and
>> then selecting properties (before navigating the various tabs and
>> clicking some more). 
> 
> Not really Cygwin-specific, but look up the Shell API on MSDN [*]
> (which you can invoke via rundll/rundll32), in particular, the
> SHObjectProperties function.
> 
> To put this back on-topic, if you do manage to find a way to do what
> you want that works on all OS's, please consider making a
> cygstart-like utility to do this and contributing it to the Cygwin
> distribution. 
> 
> HTH,
> 	Igor
> [*] One of the possible pointers is
> <http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/functions.asp>
> --
> 				http://cs.nyu.edu/~pechtcha/
>       |\      _,,,---,,_		pechtcha@cs.nyu.edu
> ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
>      |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
>     '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!
> 
> "Happiness lies in being privileged to work hard for long hours in
> doing whatever you think is worth doing."  -- Dr. Jubal Harshaw

I have a perl script that I use from a Windows command prompt that does this.

It uses Digest::MD5, Win32::File, Win32::File::VersionInfo, and Win32::FileTime to get as much information as possible.

It won't run under a cygwin prompt because I don't have all of those Win32 modules available, but if you are interested, I can send it to you.

Here is a sample of the output:
C:\Tools\Code\projects\file-version>perl file-version-edit.pl \tools\sysinternals\pslist.exe

File: \tools\sysinternals\pslist.exe
Your file seems to exist.
Win32::File::GetAttrubutes("\tools\sysinternals\pslist.exe",$fattr) -> 32
$finfo = Win32::File::VersionInfo::GetFileVersionInfo("\tools\sysinternals\pslist.exe") -> HASH(0x183f094)
$ftime = Win32::FileTime->new("\tools\sysinternals\pslist.exe") -> Win32::FileTime=HASH(0x18353cc)
File Version: 1.26.0.0
Product Version: 1.26.0.0
OS: NT/Win32
Type: Application
Date: 0000000000000000
Language: English (United States)
Comments:
CompanyName: Sysinternals
FileDescription: Sysinternals PsList
FileVersion: 1.26
InternalName: pslist
Copyright: Copyright ⌐ 2000-2004 Mark Russinovich
Trademarks:
OriginalFilename: pslist.exe
ProductName: Sysinternals pslist
ProductVersion: 1.26
PrivateBuild:
SpecialBuild:
File Attributes: archive
Created : 2004/05/31 14:25:04
Accessed : 2004/07/29 10:20:03
Modified : 2004/05/31 14:25:04
MD5 Checksum: 28ad0aaa0190120c65484d8e079daa62

C:\Tools\Code\projects\file-version>

-Jason

PS - I apologize in advance for the legal disclaimer at the bottom of my email message.  This is tacked on by our SMTP gateway and I have no control over it.
-- 

------------------------------------------------------------------------------
Confidentiality notice:
This e-mail message, including any attachments, may contain legally privileged and/or confidential
information. If you are not the intended recipient(s), or the employee or agent responsible for delivery
of this message to the intended recipient(s), you are hereby notified that any dissemination,
distribution, or copying of this e-mail message is strictly prohibited. If you have received this message
in error, please immediately notify the sender and delete this e-mail message from your computer.

==============================================================================

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-07-30  2:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-29 10:37 Accessing Property Sheets George
2004-07-29 18:47 ` Igor Pechtchanski
2004-07-30  6:53   ` George
2004-07-29 19:02 DePriest, Jason R.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).