[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

RE: File transfer using Shell

Martin Fishlock

12/12/2006 11:41:00 AM

Mike,

In the batch file on the ftp command put the full path to the command file or
try changing drive and directory to the batch file in the batch file. where
the command file is.
--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


"Mike" wrote:

> Hi,
>
> I'm not sure if this is an Excel question or an FTP one but in either case
> any help would be appreciated.
>
> I import files from a server onto my PC using these commands within a .bat
> file called "import wams files.bat:-
>
> cls
> echo on
> ftp -s:locquery.cmd incfam
>
> incfam is the server and the .cmd file contains the actual files to get:-
>
> cd /users/synergy/kemira/live/data
> get LOFILE11 o:\products\wams\lofile11
> get LOFILE12 o:\products\wams\lofile12
> get LOFILE18 o:\products\wams\lofile18
> get LOFILE19 o:\products\wams\lofile19
> get LOFILE20 o:\products\wams\lofile20
> get LOFILE22 o:\products\wams\lofile22
> bye
>
> It all works perfectly if a simply double click the .bat file but if I call
> it from within Excel using:-
>
> Sub getfiles()
> Dim returnedvalue
> returnedvalue = Shell("o:\products\wams\import wams files.bat", 1)
> End Sub
>
> The .bat file runs but the files aren't copied. Once again any thoughts
> would be appreciated.
>
> Mike
1 Answer

Mike

12/12/2006 12:26:00 PM

0

Martin,

Thanks for that. Entering the full path name to the .cmd file and removing
the spaces from the file name and directory did the trick. Strange that the
problem only arose when called from within Excel but I think I'm happy not to
understand as long as it works.

Mike

"Martin Fishlock" wrote:

> Mike,
>
> In the batch file on the ftp command put the full path to the command file or
> try changing drive and directory to the batch file in the batch file. where
> the command file is.
> --
> Hope this helps
> Martin Fishlock
> Please do not forget to rate this reply.
>
>
> "Mike" wrote:
>
> > Hi,
> >
> > I'm not sure if this is an Excel question or an FTP one but in either case
> > any help would be appreciated.
> >
> > I import files from a server onto my PC using these commands within a .bat
> > file called "import wams files.bat:-
> >
> > cls
> > echo on
> > ftp -s:locquery.cmd incfam
> >
> > incfam is the server and the .cmd file contains the actual files to get:-
> >
> > cd /users/synergy/kemira/live/data
> > get LOFILE11 o:\products\wams\lofile11
> > get LOFILE12 o:\products\wams\lofile12
> > get LOFILE18 o:\products\wams\lofile18
> > get LOFILE19 o:\products\wams\lofile19
> > get LOFILE20 o:\products\wams\lofile20
> > get LOFILE22 o:\products\wams\lofile22
> > bye
> >
> > It all works perfectly if a simply double click the .bat file but if I call
> > it from within Excel using:-
> >
> > Sub getfiles()
> > Dim returnedvalue
> > returnedvalue = Shell("o:\products\wams\import wams files.bat", 1)
> > End Sub
> >
> > The .bat file runs but the files aren't copied. Once again any thoughts
> > would be appreciated.
> >
> > Mike