Solved

FTp Scripts and UNC paths

Posted on 2006-10-26
2
3,156 Views
Last Modified: 2013-11-29
Hi I am running a process over the next 30 days where I want to push files from a network location (hopefully just using its UNC path) to an ftp location.  I am using a vbs to start the ftp script.  I have been unable to set the lcd in the ftp script to the desired unc path so as a work around I am mapping a drive i the vbscript, running the ftp, and then removing the mapped drive.

Because of the time delays of ftping the files I have added (I know a pretty ugly one) a loop for the delay before the drive is diconnected.  I would prefer to just be able to set the lcd to the unc share.  Is this possible?

Here is my filename.ftp
---------------------------------------------------------------------
echo on
open ftplocation
usernamehere
passwordhere
cd /remoted directory/
lcd t:\
mput *.*
close
quit
---------------------------------------------------------------------

here is my vbscript file:
---------------------------------------------------------------------
' set the ftp filename
strFTPScript = "filename.ftp"
'map the network path
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "T:", "\\svnw1\GuyFawkes$"
'run the ftp script
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run ("ftp -i -s:" & chr(34) & strFTPScript & chr(34))
Set objShell = Nothing
' do a loop for a time delay
For i = 1 to 20000000
Next
'disconnect the network drive and cleanup
objNetwork.RemoveNetworkDrive "T:"
set objNetwork = Nothing
---------------------------------------------------------------------


Is there a better way to do this? Cheers

I was hoping top be able to do something like............

Here is my filename.ftp
---------------------------------------------------------------------
echo on
open ftplocation
usernamehere
passwordhere
cd /remoted directory/
lcd \\server\sharename$
mput *.*
close
quit

is my issue with the fact that it is a hidden share?
0
Comment
Question by:nzfire
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Assisted Solution

by:LindyMoff
LindyMoff earned 250 total points
ID: 17816711
Yeah, I'm pretty sure lcd is going to behave just like "cd" -- so not much chance it'll work.

Here's another thought -- why don't you copy files to a local "staging area" and then FTP them up?  Something tells me from your timeout that this could be a lot of data, but it might be worth it to guarantee that you get the entire data set.
0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 250 total points
ID: 17817275
tI doubt if a unc is supported by lcd ... but have you just tried

mput \\Server\share\path\*.*

Can't try it right now to check myself, sorry.

What else is involved in your VB script.  Perhaps we could write it all in a batch file then if you run ftp.exe the script will wait until it has finished (or you can also watch tasklist until ftp.exe disappears)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
For many of us, the  holiday season kindles the natural urge to give back to our friends, family members and communities. While it's easy for friends to notice the impact of such deeds, understanding the contributions of businesses and enterprises i…
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question