mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[MOVEFILE]
Open source the movefile utily that allows queueing deletion/renaming operations for the next reboot svn path=/trunk/; revision=75531
This commit is contained in:
parent
88fd33f6a2
commit
9e84082a45
4 changed files with 42 additions and 0 deletions
|
@ -1,2 +1,3 @@
|
||||||
|
add_subdirectory(movefile)
|
||||||
add_subdirectory(ntfsinfo)
|
add_subdirectory(ntfsinfo)
|
||||||
add_subdirectory(pendmoves)
|
add_subdirectory(pendmoves)
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
list(APPEND SOURCE movefile.c movefile.rc)
|
||||||
|
add_executable(movefile ${SOURCE})
|
||||||
|
set_module_type(movefile win32cui UNICODE)
|
||||||
|
add_importlibs(movefile msvcrt kernel32 ntdll)
|
||||||
|
add_cd_file(TARGET movefile DESTINATION reactos/system32 FOR all)
|
32
rosapps/applications/rosinternals/movefile/movefile.c
Normal file
32
rosapps/applications/rosinternals/movefile/movefile.c
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
|
* PROJECT: ReactOS pending moves operations interactions tool
|
||||||
|
* FILE: cmdutils/movefile/movefile.c
|
||||||
|
* PURPOSE: Queue move operations for next reboot
|
||||||
|
* PROGRAMMERS: Pierre Schweitzer <pierre@reactos.org>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <tchar.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
__cdecl
|
||||||
|
_tmain(int argc, const TCHAR *argv[])
|
||||||
|
{
|
||||||
|
/* We need source + target */
|
||||||
|
if (argc < 3)
|
||||||
|
{
|
||||||
|
_ftprintf(stderr, _T("Missing arguments\nUsage: %s source target\nUse \"\" as target is you want deletion\n"), argv[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If target is empty, it means deletion, so provide null pointer */
|
||||||
|
if (!MoveFileEx(argv[1], (argv[2][0] == 0 ? NULL : argv[2]), MOVEFILE_DELAY_UNTIL_REBOOT))
|
||||||
|
{
|
||||||
|
_ftprintf(stderr, _T("Error: %d\n"), GetLastError());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
4
rosapps/applications/rosinternals/movefile/movefile.rc
Normal file
4
rosapps/applications/rosinternals/movefile/movefile.rc
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#define REACTOS_STR_FILE_DESCRIPTION "Queue move operations for next reboot\0"
|
||||||
|
#define REACTOS_STR_INTERNAL_NAME "movefile\0"
|
||||||
|
#define REACTOS_STR_ORIGINAL_FILENAME "movefile.exe\0"
|
||||||
|
#include <reactos/version.rc>
|
Loading…
Reference in a new issue