Windows open file tool

OpenFile function (winbase.h)

Creates, opens, reopens, or deletes a file.

Syntax

Parameters

The name of the file.

The string must consist of characters from the 8-bit Windows character set. The OpenFile function does not support Unicode file names or opening named pipes.

A pointer to the OFSTRUCT structure that receives information about a file when it is first opened.

The structure can be used in subsequent calls to the OpenFile function to see an open file.

The OFSTRUCT structure contains a path string member with a length that is limited to OFS_MAXPATHNAME characters, which is 128 characters. Because of this, you cannot use the OpenFile function to open a file with a path length that exceeds 128 characters. The CreateFile function does not have this path length limitation.

The action to be taken.

This parameter can be one or more of the following values.

Value Meaning
OF_CANCEL 0x00000800 Ignored.

To produce a dialog box containing a Cancel button, use OF_PROMPT.

OF_CREATE 0x00001000 Creates a new file.

If the file exists, it is truncated to zero (0) length.

OF_DELETE 0x00000200 Deletes a file.
OF_EXIST 0x00004000 Opens a file and then closes it.

Use this to test for the existence of a file.

OF_PARSE 0x00000100 Fills the OFSTRUCT structure, but does not do anything else.
OF_PROMPT 0x00002000 Displays a dialog box if a requested file does not exist.

A dialog box informs a user that the system cannot find a file, and it contains Retry and Cancel buttons. The Cancel button directs OpenFile to return a file-not-found error message.

OF_READ 0x00000000 Opens a file for reading only.
OF_READWRITE 0x00000002 Opens a file with read/write permissions.
OF_REOPEN 0x00008000 Opens a file by using information in the reopen buffer.
OF_SHARE_COMPAT 0x00000000 For MS-DOS–based file systems, opens a file with compatibility mode, allows any process on a specified computer to open the file any number of times.

Other efforts to open a file with other sharing modes fail. This flag is mapped to the FILE_SHARE_READ|FILE_SHARE_WRITE flags of the CreateFile function.

OF_SHARE_DENY_NONE 0x00000040 Opens a file without denying read or write access to other processes.

On MS-DOS-based file systems, if the file has been opened in compatibility mode by any other process, the function fails.

This flag is mapped to the FILE_SHARE_READ|FILE_SHARE_WRITE flags of the CreateFile function.

OF_SHARE_DENY_READ 0x00000030 Opens a file and denies read access to other processes.

On MS-DOS-based file systems, if the file has been opened in compatibility mode, or for read access by any other process, the function fails.

This flag is mapped to the FILE_SHARE_WRITE flag of the CreateFile function.

OF_SHARE_DENY_WRITE 0x00000020 Opens a file and denies write access to other processes.

On MS-DOS-based file systems, if a file has been opened in compatibility mode, or for write access by any other process, the function fails.

This flag is mapped to the FILE_SHARE_READ flag of the CreateFile function.

OF_SHARE_EXCLUSIVE 0x00000010 Opens a file with exclusive mode, and denies both read/write access to other processes. If a file has been opened in any other mode for read/write access, even by the current process, the function fails.
OF_VERIFY Verifies that the date and time of a file are the same as when it was opened previously.

This is useful as an extra check for read-only files.

OF_WRITE 0x00000001 Opens a file for write access only.

Return value

If the function succeeds, the return value specifies a file handle to use when performing file I/O. To close the file, call the CloseHandle function using this handle.

If the function fails, the return value is HFILE_ERROR. To get extended error information, call GetLastError.

Remarks

If the lpFileName parameter specifies a file name and extension only, this function searches for a matching file in the following directories and the order shown:

  1. The directory where an application is loaded.
  2. The current directory.
  3. The Windows system directory.

Use the GetSystemDirectory function to get the path of this directory.

The 16-bit Windows system directory.

There is not a function that retrieves the path of this directory, but it is searched.

The Windows directory.

Use the GetWindowsDirectory function to get the path of this directory.

  • The directories that are listed in the PATH environment variable.
  • The lpFileName parameter cannot contain wildcard characters.

    The OpenFile function does not support the OF_SEARCH flag that the 16-bit Windows OpenFile function supports. The OF_SEARCH flag directs the system to search for a matching file even when a file name includes a full path. Use the SearchPath function to search for a file.

    A sharing violation occurs if an attempt is made to open a file or directory for deletion on a remote machine when the value of the uStyle parameter is the OF_DELETE access flag OR’ed with any other access flag, and the remote file or directory has not been opened with FILE_SHARE_DELETE share access. To avoid the sharing violation in this scenario, open the remote file or directory with OF_DELETE access only, or call DeleteFile without first opening the file or directory for deletion.

    In WindowsВ 8 and Windows ServerВ 2012, this function is supported by the following technologies.

    Technology Supported
    Server Message Block (SMB) 3.0 protocol Yes
    SMB 3.0 Transparent Failover (TFO) Yes
    SMB 3.0 with Scale-out File Shares (SO) Yes
    Cluster Shared Volume File System (CsvFS) Yes
    Resilient File System (ReFS) Yes

    В

    CsvFs will do redirected IO for compressed files.

    Handle v4.22

    By Mark Russinovich

    Published: June 14, 2019

    Download Handle (887 KB)

    Introduction

    Ever wondered which program has a particular file or directory open? Now you can find out. Handle is a utility that displays information about open handles for any process in the system. You can use it to see the programs that have a file open, or to see the object types and names of all the handles of a program.

    You can also get a GUI-based version of this program, Process Explorer, here at Sysinternals.

    Installation

    You run Handle by typing «handle». You must have administrative privilege to run Handle.

    Usage

    Handle is targeted at searching for open file references, so if you do not specify any command-line parameters it will list the values of all the handles in the system that refer to open files and the names of the files. It also takes several parameters that modify this behavior.

    usage: handle [[-a] [-u] | [-c [-l] [-y]] | [-s]] [-p

    Parameter Description
    -a Dump information about all types of handles, not just those that refer to files. Other types include ports, Registry keys, synchronization primitives, threads, and processes.
    -c Closes the specified handle (interpreted as a hexadecimal number). You must specify the process by its PID.
    WARNING: Closing handles can cause application or system instability.
    -l Dump the sizes of pagefile-backed sections.
    -y Don’t prompt for close handle confirmation.
    -s Print count of each type of handle open.
    -u Show the owning user name when searching for handles.
    -p Instead of examining all the handles in the system, this parameter narrows Handle’s scan to those processes that begin with the name process. Thus:
    handle -p exp
    would dump the open files for all processes that start with «exp», which would include Explorer.
    name This parameter is present so that you can direct Handle to search for references to an object with a particular name.
    For example, if you wanted to know which process (if any) has «c:\windows\system32» open you could type:
    handle windows\system
    The name match is case-insensitive and the fragment specified can be anywhere in the paths you are interested in.

    Handle Output

    When not in search mode (enabled by specifying a name fragment as a parameter), Handle divides its output into sections for each process it is printing handle information for. Dashed lines are used as a separator, immediately below which you will see the process name and its process id (PID). Beneath the process name are listed handle values (in hexadecimal), the type of object the handle is associated with, and the name of the object if it has one.

    When in search mode, Handle prints the process names and id’s are listed on the left side and the names of the objects that had a match are on the right.

    More Information

    You can find more information on the Object Manager in Windows Internals, 4th Edition or by browsing the Object Manager name-space with WinObj.

    Download Handle (887 KB)

    Sysinternals File and Disk Utilities

    AccessChk
    This tool shows you the accesses the user or group you specify has to files, Registry keys or Windows services.

    AccessEnum
    This simple yet powerful security tool shows you who has what access to directories, files and Registry keys on your systems. Use it to find holes in your permissions.

    CacheSet
    CacheSet is a program that allows you to control the Cache Manager’s working set size using functions provided by NT. It’s compatible with all versions of NT.

    Contig
    Wish you could quickly defragment your frequently used files? Use Contig to optimize individual files, or to create new files that are contiguous.

    Disk2vhd
    Disk2vhd simplifies the migration of physical systems into virtual machines (p2v).

    DiskExt
    Display volume disk-mappings.

    DiskMon
    This utility captures all hard disk activity or acts like a software disk activity light in your system tray.

    DiskView
    Graphical disk sector utility.

    Disk Usage (DU)
    View disk usage by directory.

    EFSDump
    View information for encrypted files.

    FindLinks
    FindLinks reports the file index and any hard links (alternate file paths on the same volume) that exist for the specified file.В A file’s data remains allocated so long as at it has at least one file name referencing it.

    Junction
    Create Win2K NTFS symbolic links.

    LDMDump
    Dump the contents of the Logical Disk Manager»s on-disk database, which describes the partitioning of Windows 2000 Dynamic disks.

    MoveFile
    Schedule file rename and delete commands for the next reboot. This can be useful for cleaning stubborn or in-use malware files.

    NTFSInfo
    Use NTFSInfo to see detailed information about NTFS volumes, including the size and location of the Master File Table (MFT) and MFT-zone, as well as the sizes of the NTFS meta-data files.

    PageDefrag
    Defragment the Windows paging file and Registry hives.

    PendMoves
    See what files are scheduled for delete or rename the next time the system boots.

    Process Monitor
    Monitor file system, Registry, process, thread and DLL activity in real-time.

    PsFile
    See what files are opened remotely.

    PsTools
    The PsTools suite includes command-line utilities for listing the processes running on local or remote computers, running processes remotely, rebooting computers, dumping event logs, and more.

    SDelete
    Securely overwrite your sensitive files and cleanse your free space of previously deleted files using this DoD-compliant secure delete program.

    ShareEnum
    Scan file shares on your network and view their security settings to close security holes.

    Sigcheck
    Dump file version information and verify that images on your system are digitally signed.

    Streams
    Reveal NTFS alternate streams.

    Sync
    Flush cached data to disk.

    VolumeID
    Set Volume ID of FAT or NTFS drives.

    MDF Open File Tool for Windows

    Softonic review

    Fixing Microsoft SQL Server

    MDF Open File Tool is a development and I.T. software developed by Open Files, Inc. This computer repair service helps developers to fix broken Microsoft SQL Server databases. There is no need to have any backup copies for the analysis. Users can find the source of the problem inside their database.

    Database Solution For Users

    MDF files are disc images created from disc authoring programs. It is like ISO files, but different in format. The data from discs are stored while keeping the header and track information in the MDS file. Database programs like Microsoft SQL Server use MDF files. It reads database files inside SQL servers, as well as server add-ons. There will be instances where MDF files get corrupted or damaged in the database. MDF Open File Tool can repair any problematic database and bring them back to their optimal state. It skips the extra step of saving and opening backup copies for the repair procedure. The software has every tool for checking the cause of problems in the database. It has restoration features, standard database procedures, and interactive customers objects. It reads any versions of MDF database files from Microsoft SQL Server 6 to 2016 edition. Users can parse and open each of them. It can recover both primary and secondary keys. This software is capable of extracting and saving every data and tables from the customer’s side. Users select the MDF files for diagnostics, preview the data, select the file format to export, and save it on the computer. The export format options available are MDF + NDF files. The software guarantees professional-level analysis for MDF files and backup copies. It can restore the last changes done in the database. This increases the chance of recovering any lost data. The software can even read customized MDF files from other developers. Users have the option of uploading the analyzed MDF file to the server directly or saving them as sets of SQL scripts. They can activate the restored file after comparing it against the original copy.

    Saving Everything From The Server

    MDF Open File Tool can save precious files from SQL servers. It has everything for performing restoration of MDF files. Users can switch between the original or recovered copy of MDF files and every version of Microsoft SQL Server is compatible with this software.

    Author’s review

    MDF Open File Tool provides powerful MDF repair engine, working on any PC

    MDF Open File Tool is exactly what you’d like to have in any case of database corruption, affecting the internal structure of MS SQL Server databases. This software runs on any computer regardless the configuration in use, the processing of damaged information is possible on virtually and PC workstation, including older hardware. It guarantees the confidentiality of all operations and safely parses MDF databases in any case.

    MDF Open File Tool is one of the easiest data recovery programs, analyzing corrupted files of MDF format so you can minimize data corruption threats and improve your chances of repairing MS SQL Server databases. This software allows recovering the latest modifications in MDF files, this information is often absent in original backups because these files are often out of date. MDF Open File Tool supports any version of Microsoft SQL Server database, so there are no compatibility issues, just get a small installation program of database recovery tool, follow its guidelines and prepare to start the recovery of SQL database, used in your company. Indeed, this solution suits any hardware configuration in use, but it does not mean you should use it on older computers. Since MDF files are always pretty large, it is strongly recommended that you install MDF Open File Tool on modern computers to open corrupted documents faster and easily.

    Try MDF Open File Tool if the damage affects corrupted databases in MS SQL Server format and restore all tables, items and other objects on any computer, connected to the database server of your company. This tool repairs MDF files of any version.

    Читайте также:  Активация windows 10 крякнутый exe
    Оцените статью