- Openfiles — какие файлы открыты в Windows
- Параметр /local
- Get file properties
- Prerequisites
- Getting a file’s top-level properties
- Getting a file’s basic properties
- Getting a file’s extended properties
- 4 Ways to Open File Properties in Windows 10
- How to Open File Properties in Windows 10
- Way 1 – Through Right-click Context Menu
- Way 2 – Via File Properties Keyboard Shortcut
- Way 3 – Using Keyboard and Mouse Combination
- Way 4 – Using Properties Icon in File Explorer
- Conclusion
- Open windows file/folder properties dialog from C
- 2 Answers 2
- Windows Command to get all information/properties of a file
- 3 Answers 3
- Not the answer you’re looking for? Browse other questions tagged windows cmd.exe or ask your own question.
- Linked
- Related
- Hot Network Questions
- Subscribe to RSS
Openfiles — какие файлы открыты в Windows
Время от времени некоторые файлы имеют свойство блокироваться различными приложениями, работающими в системе. Многие из нас сталкивались с подобной ситуацией, и нам не терпелось взглянуть получить ответ, взглянуть на то, какие же именно процессы блокируют так нас интересующие ресурсы. Да и попросту посмотреть на то, какие же файлы открыты в данный момент в системе. Работать с дескрипторами файлов в системе имеют возможность практически все без исключения процессы, являющиеся как частью ядра системы, так и частью пользовательского режима. Согласитесь, что сама по себе информация об открытых в системе файла была бы весьма неполной без возможности узнать имя виновного процесса, использующего интересующий нас файл. Начиная с Windows XP Microsoft предоставила в распоряжение пользователей довольно удобное средство по работе с информацией об открытых в системе файлах — это системная утилита openfiles. Утилита openfiles является консольной, то есть позволяет получить на консоль информацию об открытых в данный момент файлах. Вероятно, многим будет удобнее использовать различные утилиты сторонних разработчиков с графическим интерфейсом, как более наглядное и удобное средство анализа, однако преимущество openfiles заключается в возможности использования её вывода в скриптах автоматизации различного назначения. Исполняемый файл утилиты располагается в системной директории %SystemRoot%\System32 . Помимо списка файлов, открытых локальными процессами, утилита позволяет вывести список файлов, открытых с использованием удаленного доступа. Для работы с утилитой пользователю требуются права локального администратора, то есть вхождение в группу Администраторы на станции.
При попытке запуска от пользователя с ограниченными правами, мы получаем сообщение вида:
Утилита openfiles имеет три основных команды: local, disconnect и query, которые мы с Вами сейчас и рассмотрим подробнее.
Параметр /local
Включает/выключает глобальный системный флаг под названием «Построение списка объектов» (Maintain Objects List).
Если команда используется без указания параметров, то есть в виде openfiles /local , то в этом случае отображается текущий статус глобального системного флага «Построение списка объектов». Помните, что включение данного системного флага может отрицательно сказаться на быстродействии системы в целом, то есть, проще говоря — сделать её медленнее. Поэтому, рекомендуется включать флаг только на время диагностики.
Системные глобальные флаги Windows хранятся в системе в глобальной переменной NtGlobalFlags , и отвечают за включение различных отладочных, следящих и проверочных механизмов в операционной системе. Переменная NtGlobalFlags инициализируется на этапе загрузки системы на основе значения ключа GlobalFlag , расположенного в ветке реестра HKLM\SYSTEM\CurrentControlSet\Control\Session Manager . В комплекте Debugging Tools for Windows имеется средство под названием gflags.exe , которое представляет из себя конфигуратор глобальных флагов Windows с графическим интерфейсом, однако, что касается флага «Построение списка объектов», то есть Вы там не найдете, поскольку это флаг режима загрузки и значение его не может быть изменено утилитой.
openfiles /local [on | off]
Параметр | Описание |
---|---|
[on | off] | Включает или выключается системный глобальный флаг «Maintain Objects List», который отслеживает локальные файловые дескрипторы. |
/? | Выводит подсказку по синтаксису опций, используемых в команде /local. |
Для получения текущего состояния системного флага:
Например в ситуации, когда флаг включен, вы увидите следующий вывод:
Get file properties
Important APIs
Get properties—top-level, basic, and extended—for a file represented by a StorageFile object.
For a complete sample, see the File access sample.
Prerequisites
Understand async programming for Universal Windows Platform (UWP) apps
You can learn how to write asynchronous apps in C# or Visual Basic, see Call asynchronous APIs in C# or Visual Basic. To learn how to write asynchronous apps in C++, see Asynchronous programming in C++.
Access permissions to the location
For example, the code in these examples require the picturesLibrary capability, but your location may require a different capability or no capability at all. To learn more, see File access permissions.
Getting a file’s top-level properties
Many top-level file properties are accessible as members of the StorageFile class. These properties include the files attributes, content type, creation date, display name, file type, and so on.
Remember to declare the picturesLibrary capability.
This example enumerates all of the files in the Pictures library, accessing a few of each file’s top-level properties.
Getting a file’s basic properties
Many basic file properties are obtained by first calling the StorageFile.GetBasicPropertiesAsync method. This method returns a BasicProperties object, which defines properties for the size of the item (file or folder) as well as when the item was last modified.
This example enumerates all of the files in the Pictures library, accessing a few of each file’s basic properties.
Getting a file’s extended properties
Aside from the top-level and basic file properties, there are many properties associated with the file’s contents. These extended properties are accessed by calling the BasicProperties.RetrievePropertiesAsync method. (A BasicProperties object is obtained by calling the StorageFile.Properties property.) While top-level and basic file properties are accessible as properties of a class—StorageFile and BasicProperties, respectively—extended properties are obtained by passing an IEnumerable collection of String objects representing the names of the properties that are to be retrieved to the BasicProperties.RetrievePropertiesAsync method. This method then returns an IDictionary collection. Each extended property is then retrieved from the collection by name or by index.
This example enumerates all of the files in the Pictures library, specifies the names of desired properties (DataAccessed and FileOwner) in a List object, passes that List object to BasicProperties.RetrievePropertiesAsync to retrieve those properties, and then retrieves those properties by name from the returned IDictionary object.
See the Windows Core Properties for a complete list of a file’s extended properties.
4 Ways to Open File Properties in Windows 10
Methods and Steps to Open File Properties in Windows 10. – Whenever you create a file, Windows generates details of the file and these details are saved in properties. The properties include creation date, size and many different info in multiple tabs. You might need to see the details of the file for certain causes on Windows 10.
File properties display information about a file such as its attributes, location, size, date of modification, owner, and a lot more. Through its dialog box, you can not only find the details but also perform several important tasks. Apart from this, it allows the modification of name, attribute, open with, permission as well. File Properties on Windows 10 makes your files easier to arrange – such as you can sort the files by going through its creation or modified date. See a guide including the methods to open File Properties in Windows 10.
How to Open File Properties in Windows 10
Way 1 – Through Right-click Context Menu
Step 1 – Begin the procedure by finding your file whose Properties you wish to open. Now, do a right-click on it, and from the pop-up context menu, click Properties.
Step 2 – Finally, your file or folder Properties dialog box will be visible on the screen.
Way 2 – Via File Properties Keyboard Shortcut
Step 1 – Locate and select your file.
Step 2 – After selecting the file, just press the combination of Alt and Enter keys. This combination of hotkeys will promptly launch file Properties in Windows 10.
Way 3 – Using Keyboard and Mouse Combination
Step 1 – Hold the Alt key on the keyboard.
Step 2 – Now, make a double-click your file. This is the quickest way to open File Properties dialog box in Windows 10.
Way 4 – Using Properties Icon in File Explorer
Step 1 – In File Explorer, navigate to your file. Once your appropriate file is visible, select it.
Step 2 – Now, move to the title bar and click the Properties icon. A little icon with a red color tick mark on the title bar is the Properties icon.
Step 3 – Within no time, the file Properties dialog box will appear on the screen.
Now let’s see what you will find after you open File Properties.
4 different tabs are there and each tab holds separate functionality. Let us now go through each tab of File Properties on Windows 10.
General – On the first tab you can see the fundamental information of the file such as its type, location, size, creation date, attributes, and a lot more.
Security – The second tab allows you to manage permissions as who can actually access the file.
Details – This tab shows every information of the file. The information on this tab varies for different file types – for songs, you will see album & artists name, length, etc whereas, for an image, its dimensions, size, type, and other related things are displayed.
Previous Versions – On this ending tab, you will find all the older versions of your file after you set up “File History backup”.
Conclusion
Well, the holding of the Alt key and then double-clicking the file or folder is certainly considered as the easiest method to open File Properties in Windows 10. If you know more methods, please take help of the comments form below and write them to us.
Open windows file/folder properties dialog from C
I have this tiny programm, which is intened to show windows file/folder properties dialog on the specified info.lpFile :
When I compile and execute it, I get the following error message:
I’m using Win7 and Mingw gcc compiler. Does anybody knows what is wrong with my code? Am I missing something?
2 Answers 2
1st of all the code as shown does not properly initialise info .
To fix this change
2ndly use SEE_MASK_INVOKEIDLIST for SHELLEXECUTEINFO ‘s member fMask .
Please note that to see the properties window open, the invoking code must not end immediately. So add something like
to the end of your test code as shown.
Full code that works for me:
(Tested with VS2010, running Windows 7)
I’d start by initializing info:
Then, I’d try a verb that actually exists in the registry under HKEY_CLASSES_ROOT\txtfile\shell
Which I strongly suspect will work. The problem is, explorer does not launch an application to show the properties of files — its built in. Not every piece of functionality on a file context menu is a verb that you can invoke via ShellExecute.
If you want to invoke the properties context menu item for a file — you will need to query for the IShellFolder that represents the files folder, call GetUIObjectOf to get the IContextMenu for the file, which you can then call InvokeCommand on.
Windows Command to get all information/properties of a file
Is there any command get all the properties of a file including its encoding format (this piece of information is really important to me) on Windows ? I’m looking for something similar to stat in Linux
I’d prefer using a command that can be used in command-prompt or a batch script although I know its possible with Powershell.
3 Answers 3
You can use WMIC feature to do that.
to get all information about anyfile.txt. You can use CMD and powershell too to using WMIC. And you can use GET parameter to get a specified information.
EDIT : Try using this before to check the WMIC functionality :
To get a help how to using it.
Output in eko_wmic.txt:
Hope this’ll help you out..
To build on the previous answer. You can use wmic datafile to get info about a file, but you have to provide the full path and double-up your slashes like so
This gives an unreadable mess in the console, as you’ll see:
However if you pipe this into a text file, it’s pretty legible
Fortunately, wmic can format the info as a list, and then it is actually pretty useful.
You can then provide these properties only for a simplified view, note that you must remove the list keyword.
A little piece of trivia, wmic was the foundation for what eventually became PowerShell!
You can use any scripting language that can use COM objects such as vbscript and powershell to access a files extended properties (Title, Duration, Frame rate, etc.) using the Shell.Application object. Unfortunately, cmd does not have a direct way to access the Shell object, you will have to piggyback on some other scripting language to access the Shell object.
Running the following command from a cmd prompt window will display the duration of the video file in 100ns units (not milliseconds).
Additional information about the command can be found at Enumerate file properties in PowerShell
Not the answer you’re looking for? Browse other questions tagged windows cmd.exe or ask your own question.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.16.39093
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.