tags:

views:

51

answers:

2

i am calling a batch file for xcopy. i have the path of the file to b copied in variable a. my code is:

dim shell,z  
z="for.bat " & a & " " & b & " " & c  
set shell=createobject("wscript.shell")  

shell.Run z, 1, true  

where for.bat is:

for %%f in (%1,%2,%3) do xcopy %%f D:\shipment\ /e  

when 'a' has small path like D:\flexcube, it works. but if i put some big path, say:
D:\flexcube1\New Folder\New Folder\New Folder\New Folder\New Folder\New Folder\New Folder\New Folder\New Folder\New Folder\New Folder it does not work. is their some length restriction on %1 type variables or is this some other problem? any help is really appreciated.

+2  A: 

space is the problem. D:\flexcube1\New Folder\New Folder\ has space between New and Folder. You need to provide "" around the path.

aJ
+1  A: 

Try enclosing the directory name in quotes like this:

"D:\flexcube1\New Folder\New Folder\New Folder\New Folder\New Folder\New Folder"
Thariama
yeah the space was the problem . thanx a lot. but still if i use this path :"\\iflblw-bpd-12\Vercon_IP-BPD-01\SOFT\FLEXCUBE_Sites\BCHICL(BDC)\FC_UBS_V.UL.6.6.0.0.BCHICL.7.0" it does not work. any guesses?
sushant
you are using which OS?
Thariama
i tried it again. now its working. may b i had done some typing error. thanx for all the help
sushant
no problem, glad it is working
Thariama