Click here to Skip to main content
15,878,945 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am working with batch files in windows 7, trying to move file from one location to another through below commands.... but unable to do it.

Please help me..

This is my code.

@echo off
pause
move C:\Users\bapureddy.battu\Desktop\Bapu\Created docs\capOne.rtf D:\
@exit


Thanks in advance.
Posted
Updated 18-Mar-13 19:16pm
v2
Comments
bbirajdar 19-Mar-13 1:20am    
So you are unable to run the batch file ? Just double click it..
bapu_reddy 19-Mar-13 1:26am    
Iam running but file is n0t moving from source folder to destination....... My question is , Is there any problem with my script??? or why it is not working?..
_Maxxx_ 19-Mar-13 1:30am    
doesn't look like there's a problem assuming all is spelled correctly - I'd take out the echo off and try it - then you can see any errors

(and put the pause after the move)
bapu_reddy 19-Mar-13 1:35am    
Ya, i tried without @Echo off it was showing that "The syntax of the command is incorrect".. I placed pause after the move command as u suggested...
bapu_reddy 19-Mar-13 1:40am    
Thanks _Maxxx_ and aspnet_reiis -i, there was problem with folder name "Created docs" by removing space between the words it gets executed correctly... thank u again...

1 solution

Your file path contains spaces, so you need to enclose the name in quotes:

VB
@echo off
pause
move "C:\Users\bapureddy.battu\Desktop\Bapu\Created docs\capOne.rtf" D:\
@exit


Otherwise it tries to move the file with the name "C:\Users\bapureddy.battu\Desktop\Bapu\Created" which does not exist.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Mar-13 17:26pm    
Good point, a 5.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900