From a33bad1edd3c722810252d681a56e43391d3e1c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delanoy?= Date: Sun, 11 Sep 2011 17:14:55 +0200 Subject: [PATCH] cmd: Allow a batch file to delete itself. --- programs/cmd/batch.c | 2 +- programs/cmd/tests/test_builtins.cmd.exp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c index 70886d1049a..881c7d13d15 100644 --- a/programs/cmd/batch.c +++ b/programs/cmd/batch.c @@ -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); diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 5c022ffe479..b9285b16eed 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -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 ------------