xcopy issues from local to network drive

Raiden1803

New member
Local time
11:04 AM
Messages
3
Hello all. newbie here.

strange problem with xcopy.. started happening only with this specific batch file i wrote to back files up to my network drive. Basically i'm backing three local drives "I: (thumb drive) C: and E: To my network drive. X: (which is a seagate goflex home if that means anything..)

with this specific batch file i cannot seem to copy anything local to my network drive. instead i get a "invalid path" error message. this is my script.

Code:
@echo off
:restart
echo NETWORK DRIVE BACKUP AND RESTORE SCRIPT. 
echo Would You like to backup, or load?
set input=
set /p input=load,backup, or exit?
if %input%==load goto load
if %input%==backup goto backup
if %input%==exit goto exit
echo not a valid input
goto restart


:backup
xcopy	"I:\*.*"										"X:\Thumb drive"									/E /T /I /Y /D:5-15-2012
xcopy	"C:\Users\Dwight Sarmiento\My Documents\"						"X:\Documents"										/E /T /I /Y /D:5-15-2012
xcopy   "C:\Users\Dwight Sarmiento\AppData\Roaming\.minecraft\saves" 			 	"X:\Saved Game Files\Minecraft" 							/E /T /I /Y /D:5-15-2012
xcopy 	"C:\Users\Dwight Sarmiento\My Documents\My Games\Skyrim" 				"X:\Saved Game Files\Skyrim"				 				/E /T /I /Y /D:5-15-2012	
xcopy	"C:\Users\Dwight Sarmiento\My Documents\Square Enix\Batman Arkham Asylum GOTY"		"X:\Saved Game Files\Batman Arkham Asylum GOTY" 					/E /T /I /Y /D:5-15-2012
xcopy	"C:\Users\Dwight Sarmiento\AppData\Local\Microsoft\GFWLive" 			 	"X:\Saved Game Files\Batman Arkham Asylum GOTY\GFWLive" 				/E /T /I /Y /D:5-15-2012
xcopy	"C:\Users\Dwight Sarmiento\AppData\Local\Microsoft\Xlive" 				"X:\Saved Game Files\Batman Arkham Asylum GOTY\Xlive" 					/E /T /I /Y /D:5-15-2012	
xcopy	"C:\Users\Dwight Sarmiento\Appdata\Local\SWTOR\"					"X:\swtor"										/E /T /I /Y /D:5-15-2012
xcopy	"E:\Backgrounds" 									"X:\Backgrounds" 									/E /T /I /Y /D:5-15-2012
Xcopy	"E:\Applications" 									"X:\Applications"									/E /T /I /Y /D:5-15-2012
xcopy	"E:\Iphone" 										"X:\Iphone" 										/E /T /I /Y /D:5-15-2012
echo Files Successfully Copied
pause
exit

:load
Xcopy	"X:\Thumb Drive"									"I:\*.*"										/E /I /Y				
xcopy 	"X:\Saved Game Files\Minecraft" 							"C:\Users\Dwight Sarmiento\AppData\Roaming\.minecraft\saves" 				/E /I /Y
xcopy 	"x:\Saved Game Files\Skyrim" 								"C:\Users\Dwight Sarmiento\My Documents\My Games\Skyrim"				/E /I /Y
xcopy 	"X:\Saved Game Files\Batman Arkham Asylum GOTY" 					"C:\Users\Dwight Sarmiento\My Documents\Square Enix\Batman Arkham Asylum GOTY" 		/E /I /Y
xcopy	"X:\Saved Game Files\Batman Arkham Asylum GOTY\GFWLive"  				"C:\Users\Dwight Sarmiento\AppData\Local\Microsoft\GFWLive"				/E /I /Y
xcopy	"X:\Saved Game Files\Batman Arkham Asylum GOTY\Xlive" 					"C:\Users\Dwight Sarmiento\AppData\Local\Microsoft\Xlive"				/E /I /Y
xcopy	"I:\swtor"										"C:\Users\Dwight Sarmiento\Appdata\Local\SWTOR\"					/E /I /Y	
xcopy	"X:\Backgrounds" 									"E:\Backgrounds" 									/E /I /Y
Xcopy	"X:\Applications" 									"E:\Applications"									/E /I /Y
xcopy	"X:\Iphone" 										"E:\Iphone" 										/E /I /Y

echo Files Successfully Loaded
pause
exit

:exit
exit

to make matters even more weirder i have another script that i use to backup my itunes library to my network drive, which oddly enough works just fine.

Code:
@echo off
:restart
echo ITUNES LIBRARY BACKUP AND RESTORE SCRIPT
echo would you like to backup, or load?
set input=
set /p input=load,backup, or exit?
if %input%==load goto load
if %input%==backup goto backup
if %input%==exit goto exit
echo not a valid input
goto restart


:backup

xcopy	"E:\Itunes Library" 					"X:\Itunes Library" 	 /E /Y 

echo files Successfully Copied
pause
exit

:load

xcopy	"X:\Itunes Library"					"E:\Itunes Library"	 /E /Y	/D:5-15-2012				


echo files Successfully Loaded
pause
exit

:exit
exit

I'm not sure what im missing here, the "network drive backup and restore script" worked fine once. and now, not so much.

if anyone has any ideas on whats going wrong with my first script, i'd appreciate it.

thanks,
 

My Computer

OS
Windows 7
do you run it form command prompt window?

if so do manually:
Code:
xcopy	"I:\*.*"     "X:\Thumb drive"  /E /T /I /Y /D:5-15-2012

works?
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
Doesnt look like it, or atleast correctly anyway. when done manually it acts like its hanging there in the command prompt window and doesnt display any kind of output of what its doing. however i was able to catch it copying files to the "thumb drive" folder, even though it missed alot of things.
 

My Computer

OS
Windows 7
remove the \ after swtor!
So replace C:\Users\Dwight Sarmiento\Appdata\Local\SWTOR\
with C:\Users\Dwight Sarmiento\Appdata\Local\SWTOR

it's on two places!
replace I:\*.* with I:\
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
Doesnt look like it, or atleast correctly anyway. when done manually it acts like its hanging there in the command prompt window and doesnt display any kind of output of what its doing. however i was able to catch it copying files to the "thumb drive" folder, even though it missed alot of things.
what does it miss? empty folders? hidden files?
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
remove /T as well in all xcopy commands!
so simply open script in notepad and replace /T with nothing

xcopy/?
This shows you what /T does. It only creates folder structure and doesn't copy files!
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
I have /T in there to create the directory structure. otherwise xcopy throws this at me
Code:
Does X:\Applications specify a file name or directory on the target.F=File, D=Directory

each time i add something new to the script. is their another way to avoid that error so i dont have to keep hitting D all the time so it creates a new directory?

also, Removing the"\" did nothing, still getting the 'invalid path' error.

updated script:

Code:
@echo off
:restart
echo NETWORK DRIVE BACKUP AND RESTORE SCRIPT. 
echo Would You like to backup, or load?
set input=
set /p input=load,backup, or exit?
if %input%==load goto load
if %input%==backup goto backup
if %input%==exit goto exit
echo not a valid input
goto restart


:backup


xcopy	"C:\Users\Dwight Sarmiento\Appdata\Local\SWTOR"						"X:\swtor"										/E /T /I /Y /D:5-15-2012															
xcopy	"C:\Users\Dwight Sarmiento\My Documents\"						"X:\Documents"										/E /T /I /Y /D:5-15-2012
xcopy   "C:\Users\Dwight Sarmiento\AppData\Roaming\.minecraft\saves" 			 	"X:\Saved Game Files\Minecraft" 							/E /T /I /Y /D:5-15-2012
xcopy 	"C:\Users\Dwight Sarmiento\My Documents\My Games\Skyrim" 				"X:\Saved Game Files\Skyrim"				 				/E /T /I /Y /D:5-15-2012	
xcopy	"C:\Users\Dwight Sarmiento\My Documents\Square Enix\Batman Arkham Asylum GOTY"		"X:\Saved Game Files\Batman Arkham Asylum GOTY" 					/E /T /I /Y /D:5-15-2012
xcopy	"C:\Users\Dwight Sarmiento\AppData\Local\Microsoft\GFWLive" 			 	"X:\Saved Game Files\Batman Arkham Asylum GOTY\GFWLive" 				/E /T /I /Y /D:5-15-2012
xcopy	"C:\Users\Dwight Sarmiento\AppData\Local\Microsoft\Xlive" 				"X:\Saved Game Files\Batman Arkham Asylum GOTY\Xlive" 					/E /T /I /Y /D:5-15-2012	
xcopy	"E:\Backgrounds" 									"X:\Backgrounds" 									/E /T /I /Y /D:5-15-2012
xcopy	"E:\Applications" 									"X:\Applications"									/E /T /I /Y /D:5-15-2012
xcopy	"E:\Iphone" 										"X:\Iphone" 										/E /T /I /Y /D:5-15-2012
echo Files Successfully Copied
pause
exit

:load
xcopy	"X:\swtor"										"C:\Users\Dwight Sarmiento\Appdata\Local\SWTOR"						/E /I /Y
xcopy 	"X:\Saved Game Files\Minecraft" 							"C:\Users\Dwight Sarmiento\AppData\Roaming\.minecraft\saves" 				/E /I /Y
xcopy 	"x:\Saved Game Files\Skyrim" 								"C:\Users\Dwight Sarmiento\My Documents\My Games\Skyrim"				/E /I /Y
xcopy 	"X:\Saved Game Files\Batman Arkham Asylum GOTY" 					"C:\Users\Dwight Sarmiento\My Documents\Square Enix\Batman Arkham Asylum GOTY" 		/E /I /Y
xcopy	"X:\Saved Game Files\Batman Arkham Asylum GOTY\GFWLive"  				"C:\Users\Dwight Sarmiento\AppData\Local\Microsoft\GFWLive"				/E /I /Y
xcopy	"X:\Saved Game Files\Batman Arkham Asylum GOTY\Xlive" 					"C:\Users\Dwight Sarmiento\AppData\Local\Microsoft\Xlive"				/E /I /Y
xcopy	"X:\Backgrounds" 									"E:\Backgrounds" 									/E /I /Y
xcopy	"X:\Applications" 									"E:\Applications"									/E /I /Y
xcopy	"X:\Iphone" 										"E:\Iphone" 										/E /I /Y

echo Files Successfully Loaded
pause
exit

:exit
exit
 

My Computer

OS
Windows 7
xcopy "C:\Users\Dwight Sarmiento\My Documents\"

it has also a \ at the end!!
Why don't you just say WHICH command fails!!
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
xcopy "C:\Users\Dwight Sarmiento\My Documents\" "X:\Documents" /E /T /I /Y /D:5-15-2012

you wanna xcopy C:\Users\Dwight Sarmiento\My Documents and all subfolders.
But why do you have xcopy "C:\Users\Dwight Sarmiento\My Documents\My Games\Skyrim" and other one's in My Documts as well?
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
Does X:\Applications specify a file name or directory on the target.F=File, D=Directory

that doesn't occur if you use /I !!
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
You wanna clone some folders (and subfolders within it)? So even hidden and readonly files?
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
ACER ASPIRE 5742G
OS
Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz
Motherboard
Acer Aspire 5742G
Memory
4,00 GB
Graphics Card(s)
ATI Mobility Radeon HD 5400 Series
Sound Card
(1) AMD High Definition Audio Device (2) Realtek High Defi
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
WDC WD5000BEVT-22ZAT0
Back
Top