Jump to content
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
humbletech99

Get File Properties Tabs from CMD prompt?

Recommended Posts

Does anyone know of a way to get the file/folder properties page from a cmd prompt as though you have just gone and right-clicked the file/folder in the gui?

The reason I ask is because I may have a user logged in and need to look at the file/folder properties (specifically the ntfs permissions) and because they are logged in as a user account and have no access to the folder they cannot even see the security tab of the properties box.

So I need a way from the command prompt to open the properties box of a file/folder (as I have done a runas to get an admin prompt inside their user gui session). Looking at security settings in a cmd program may also be of some interest if anyone knows that either...

Share this post


Link to post
Share on other sites

Many options are avialable for the Directory command. Go to a command prompt, Start, Run, cmd, Enter, and type dir /?

C:\>dir /?
Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
[/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

[drive:][path][filename]
Specifies drive, directory, and/or files to list.

/A Displays files with specified attributes.
attributes D Directories R Read-only files
H Hidden files A Files ready for archiving
S System files - Prefix meaning not
/B Uses bare format (no heading information or summary).
/C Display the thousand separator in file sizes. This is the
default. Use /-C to disable display of separator.
/D Same as wide but files are list sorted by column.
/L Uses lowercase.
/N New long list format where filenames are on the far right.
/O List by files in sorted order.
sortorder N By name (alphabetic) S By size (smallest first)
E By extension (alphabetic) D By date/time (oldest first)
G Group directories first - Prefix to reverse order
/P Pauses after each screenful of information.
/Q Display the owner of the file.
/S Displays files in specified directory and all subdirectories.
/T Controls which time field displayed or used for sorting
timefield C Creation
A Last Access
W Last Written
/W Uses wide list format.
/X This displays the short names generated for non-8dot3 file
names. The format is that of /N with the short name inserted
before the long name. If no short name is present, blanks are
displayed in its place.
/4 Displays four-digit years

Switches may be preset in the DIRCMD environment variable. Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.

C:\>

/A and /Q sound closest, but may not be enough for your needs.

You could also download Windows Power Shell from Microsoft for free and see if that gives you what you want:

http://www.microsoft.com/windowsserver2003...l/download.mspx

Share this post


Link to post
Share on other sites

The attrib command also looks promising:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\tleroy.LSISOLUTIONS>attrib /?
Displays or changes file attributes.

ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [drive:][path][filename]
[/S [/D]]

+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
[drive:][path][filename]
Specifies a file or files for attrib to process.
/S Processes matching files in the current folder
and all subfolders.
/D Processes folders as well.


C:\Documents and Settings\tleroy.LSISOLUTIONS>

Share this post


Link to post
Share on other sites

I think dir and attrib predate ntfs permissions?

At the very least they don't seem to support showing you the ntfs acls on files/folders. Attrib deals with file attributes like hidden or system flags rather than file security privileges like user and group information.

I'm also really curious as to whether it's possible to open from cmd the graphical file properties box.

Share this post


Link to post
Share on other sites

What about cacls?

Remember: the dos prompt is very basic and cannot perform many functions on its own. You may need to use a third party program or script rather than a command.

Share this post


Link to post
Share on other sites

I've used cacls and this is ok, you can see the permissions.

I'd really like to know how to fire up the gui though, I can do this for most gui things but not figured this bit out, something about running a shell dll....

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy