34#ifdef INCLUDE_CMD_MOVE
115 DWORD dwMoveFlags = 0;
116 DWORD dwMoveStatusFlags = 0;
121 ConOutPuts (
_T(
"Moves files and renames files and directories.\n\n"
122 "To move one or more files:\n"
123 "MOVE [/N][/Y|/-Y][drive:][path]filename1[,...] destination\n"
125 "To rename a directory:\n"
126 "MOVE [/N][/Y|/-Y][drive:][path]dirname1 dirname2\n"
128 " [drive:][path]filename1 Specifies the location and name of the file\n"
129 " or files you want to move.\n"
130 " /N Nothing. Don everthing but move files or directories.\n"
174 pszDest = (nFiles == 1) ?
_T(
".") :
arg[
i + 1];
210 (
_tcscmp(findBuffer.cFileName,
_T(
".")) == 0 ||
211 _tcscmp(findBuffer.cFileName,
_T(
"..")) == 0))
238 dwMoveStatusFlags &= ~MOVE_SOURCE_IS_DIR;
244 TRACE (
"Do we have only one file: %s\n", OnlyOneFile ?
"TRUE" :
"FALSE");
258 (
_tcscmp(findBuffer.cFileName,
_T(
".")) == 0 ||
259 _tcscmp(findBuffer.cFileName,
_T(
"..")) == 0))
272 if (szSrcDirPath[0] != szDestPath[0])
281 dwMoveStatusFlags &= ~MOVE_DEST_IS_FILE &
283 ~MOVE_SRC_CURRENT_IS_DIR &
285 _tcscpy(szFullSrcPath,szSrcDirPath);
286 if (szFullSrcPath[
_tcslen(szFullSrcPath) - 1] !=
_T(
'\\'))
288 _tcscat(szFullSrcPath,findBuffer.cFileName);
289 _tcscpy(szSrcPath, szFullSrcPath);
312 _tcscpy (szFullDestPath, szDestPath);
314 if (szFullDestPath[
_tcslen(szFullDestPath) - 1] !=
_T(
'\\'))
316 _tcscat (szFullDestPath, findBuffer.cFileName);
329 _tcscpy (szFullDestPath, szDestPath);
334 TRACE (
"Move Status Flags: 0x%X\n",dwMoveStatusFlags);
349 _tcscpy (szFullDestPath, szDestPath);
389 MoveStatus =
MoveFileEx (szSrcPath, szFullDestPath, dwMoveFlags);
392 _tcscpy(szMoveDest, szFullDestPath);
401 pszDestDirPointer = szMoveDest +
_tcslen(szMoveDest);
402 pszSrcDirPointer = szMoveSrc +
_tcslen(szMoveSrc);
423 (pszSrcDirPointer)--;
424 (pszDestDirPointer)--;
437 pszSrcDirPointer = pszSrcDirPointer - nDiff;
441 pszDestDirPointer = pszDestDirPointer - nDiff;
443 if (szMoveSrc[
_tcslen(szMoveSrc) - 1] !=
_T(
'\\'))
445 if (szMoveDest[
_tcslen(szMoveDest) - 1] !=
_T(
'\\'))
447 pszDestDirPointer = szMoveDest +
_tcslen(szMoveDest);
448 pszSrcDirPointer = szMoveSrc +
_tcslen(szMoveSrc);
464 if (
_tcscmp(findDestBuffer.cFileName,
_T(
".")) == 0 ||
465 _tcscmp(findDestBuffer.cFileName,
_T(
"..")) == 0)
468 _tcscpy(pszSrcDirPointer, findDestBuffer.cFileName);
469 _tcscpy(pszDestDirPointer, findDestBuffer.cFileName);
473 if (!FoundFile)
continue;
483 pszDestDirPointer = szMoveDest +
_tcslen(szMoveDest);
484 pszSrcDirPointer = szMoveSrc +
_tcslen(szMoveSrc);
static VOID ErrorMessage(_In_ DWORD dwErrorCode, _In_opt_ PCWSTR pszMsg,...)
VOID error_too_many_parameters(PCTSTR s)
VOID error_file_not_found(VOID)
VOID error_req_param_missing(VOID)
LPTSTR * splitspace(LPTSTR, LPINT)
VOID error_syntax(PCTSTR s)
VOID error_invalid_parameter_format(PCTSTR s)
VOID ConOutResPaging(BOOL StartPaging, UINT resID)
#define ConOutPrintf(szStr,...)
#define ConOutPuts(szStr)
@ MOVE_SRC_CURRENT_IS_DIR
INT cmd_move(LPTSTR param)
void GetDirectory(LPTSTR wholepath, LPTSTR directory, BOOL CheckExisting)
static INT MoveOverwrite(LPTSTR fn)
#define STRING_MOVE_HELP1
#define STRING_MOVE_HELP2
#define STRING_MOVE_ERROR2
#define STRING_MOVE_ERROR1
static VOID freep(LPSTR *p)
#define INVALID_HANDLE_VALUE
BOOL WINAPI FindClose(HANDLE hFindFile)
#define MOVEFILE_WRITE_THROUGH
#define MOVEFILE_REPLACE_EXISTING
#define MOVEFILE_COPY_ALLOWED
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static char szTempPath[MAX_PATH]
#define FILE_ATTRIBUTE_DIRECTORY
BOOL IsExistingDirectory(IN LPCTSTR pszPath)
BOOL IsExistingFile(IN LPCTSTR pszPath)
INT GetRootPath(IN LPCTSTR InPath, OUT LPTSTR OutPath, IN INT size)
#define ConOutResPrintf(uID,...)
INT FilePromptYNA(UINT resID)
static GLenum _GLUfuncptr fn
DWORD WINAPI GetLastError(void)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags