Solved

FTp Scripts and UNC paths

Posted on 2006-10-26
2
3,077 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
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Suggested Solutions

Please see preceding article here: http://www.experts-exchange.com/Networking/Operating_Systems/A_11209-Root-Bridge-Election.html Figure 1 After Root Bridge has been elected, then what?..... Let's start by defining a Root Port in la…
Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now