cmd: Allow a batch file to delete itself.

This commit is contained in:
Frédéric Delanoy 2011-09-11 17:14:55 +02:00 committed by Alexandre Julliard
parent cb63445b5e
commit a33bad1edd
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN
BATCH_CONTEXT *prev_context;
if (startLabel == NULL) {
h = CreateFileW (file, GENERIC_READ, FILE_SHARE_READ,
h = CreateFileW (file, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (h == INVALID_HANDLE_VALUE) {
SetLastError (ERROR_FILE_NOT_FOUND);

View File

@ -725,7 +725,7 @@ foo ''
non-builtin dir
------------ Testing cmd invocation ------------
... a batch file can delete itself ...
@todo_wine@file correctly deleted
file correctly deleted
... a batch file can alter itself ...
@todo_wine@bar
------------ Testing setlocal/endlocal ------------