deleting files in dos .. or pre install

  • Thread starter Thread starter Brenden
  • Start date Start date
B

Brenden

does anyone know how to delete files on a NTFS file system
through dos .. or a boot disk?
 
Hi,

The dos emulator is similar in most respects to the dos you are familiar
with, however it is still subject to certain restrictions (like it is still
subject to folder permissions). Why, what are you trying to do?

--
Best of Luck,

Rick Rogers aka "Nutcase" MS-MVP - Win9x
Windows isn't rocket science! That's my other hobby!

Associate Expert - WinXP - Expert Zone
 
There is no DOS in XP. You can try through the Command Prompt within XP,
Start\All Programs\Accessories\Command Prompt.

While booting from a DOS boot disk will give you a DOS prompt and access to
whatever DOS tools might also be on that disk, it can't see NTFS and even if
it could, the system wouldn't let you access the files because of the
built-in security.

There are some boot disks available, you might try a Google search for them,
that can see NTFS but I don't know how much access they will give you with
regard to the files.
 
You stick it in the registry.
If the dwFlags parameter specifies MOVEFILE_DELAY_UNTIL_REBOOT, MoveFileEx stores the locations of the files to be renamed at restart in the following registry value:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations

The function fails if it cannot access the registry.

The PendingFileRenameOperations value is of type REG_MULTI_SZ. Each rename operation stores a pair of NULL-terminated strings. The system uses these registry entries to complete the operations at restart in the same order that they were issued. For example, the following code fragment creates registry entries that delete szDstFile and rename szSrcFile to be szDstFile at restart:

MoveFileEx(szDstFile, NULL, MOVEFILE_DELAY_UNTIL_REBOOT);
MoveFileEx(szSrcFile, szDstFile, MOVEFILE_DELAY_UNTIL_REBOOT);
The system stores the following entries in PendingFileRenameOperations:

szDstFile\0\0
szSrcFile\0szDstFile\0\0Because the actual move and deletion operations specified with the MOVEFILE_DELAY_UNTIL_REBOOT flag take place after the calling application has ceased running, the return value cannot reflect success or failure in moving or deleting the file. Rather, it reflects success or failure in placing the appropriate entries into the registry.

The system deletes a directory tagged for deletion with the MOVEFILE_DELAY_UNTIL_REBOOT flag only if it is empty. To ensure deletion of directories, move or delete all files from the directory before attempting to delete it. Files may be in the directory at boot time, but they must be deleted or moved before the system can delete the directory.

The move and deletion operations are carried out at boot time in the same order they are specified in the calling application. To delete a directory that has files in it at boot time, first delete the files.

Windows 2000/XP: The MoveFileEx function coordinates its operation with the link tracking service, so link sources can be tracked as they are moved.

Windows 95/98/Me: The MoveFileEx function is not supported. To rename or delete a file at restart, use the following procedure.

To rename or delete a file on Windows 95/98/Me

1.. Check for the existence of the WININIT.INI file in the Windows directory.
2.. If WININIT.INI exists, open it and add new entries to the existing [rename] section. If the file does not exist, create the file and create a [rename] section.
3.. Add lines of the following format to the [rename] section:
DestinationFileName=SourceFileNameBoth DestinationFileName and SourceFileName must be short file names. To delete a file, use NUL as the value for DestinationFileName.

The system processes WININIT.INI during system boot. After WININIT.INI has been processed, the system names it WININIT.BAK.

To delete or rename a file, you must have either delete permission on the file or delete child permission in the parent directory. If you set up a directory with all access except delete and delete child and the ACLs of new files are inherited, then you should be able to create a file without being able to delete it. However, you can then create a file, and you will get all the access you request on the handle returned to you at the time you create the file. If you requested delete permission at the time you created the file, you could delete or rename the file with that handle but not with any other.
 
In
Brenden said:
does anyone know how to delete files on a NTFS file system
through dos .. or a boot disk?


First of all, recognize that there is no DOS in Windows XP. There
is a command prompt, a DOS emulator, which you can get to by
typing CMD at the Start | Run line. From there you can enter many
(but not all) DOS commands, including the DEL command; the fact
that the files are on an NTFS drive is irrelevant.

If you want to boot to DOS from Windows XP as you could in
Windows 9x, there's no way to do this. You can boot to a DOS
diskette, but your NTFS drive won't be visible without special
software. There is a product called NTFSDOS that lets you see
NTFS drives; it comes in two versions: a free one that gives you
only read access to the drive, and a paid one that gives you
read-write access. You would need the paid version to do what you
want.
 
Back
Top