Access denied, cmd move windows 7
Solution 1:
Try:
IF EXIST "c:\mydir" (
robocopy "%1" c:\mydir /E /IS /MOVE
) ELSE (
move /y "%1" c:\mydir
)
This will check if the folder exists and move contents if the folder exists and if the folder doesn't exits then it will move your folder. If you still get access denied then you probably need to get admin privileges.
Solution 2:
At last.. here is the solution.. Thanks for help guys :)
SET mydir=C:\mydir
IF EXIST "%mydir%\%~n1\" (
ROBOCOPY %1 "%mydir%\%~n1" /E /IS /MOVE
) ELSE (
MOVE /Y %1 "%mydir%\"
)