Solved

FTp Scripts and UNC paths

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

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…
I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
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…
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…

738 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