Solved

FTp Scripts and UNC paths

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cisco Access point 6 62
P2P and MPLS 3 46
Is WiFi half-duplex or Full -duplex 4 33
Valid LIN protocol Protected ID values 1 21
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
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…
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…

867 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

19 Experts available now in Live!

Get 1:1 Help Now