Solved

FTP Script

Posted on 2000-03-13
8
173 Views
Last Modified: 2013-12-28
Hello,

I'm trying to write a .bat based application that will FTP get some files from another machine.  First question, is it possible to use an environment variable in a .scr file?  Here is what I'm doing:  

set %filename% = example.log
FTP -n -s:doffus.scr <host>

While in the doffus.scr:
get /<location>/%filename%

Second question, would you do it this way, or is there a better way?  I would like to use the .bat approach.

Thanks
0
Comment
Question by:srobia
  • 4
  • 3
8 Comments
 
LVL 23

Expert Comment

by:Tim Holman
ID: 2613056
Does it work ?

If you're having problems, you could pipe %filename% to a file - eg in a batch file :

@echo off
echo get /<location>/%%filename%% > doffus.scr
FTP -n -s:doffus.scr

so then FTP wouldn't actually be trying to use an environment variable.

0
 

Author Comment

by:srobia
ID: 2613084
Is there a better way?
0
 
LVL 5

Expert Comment

by:carmine
ID: 2613739
I don't think so.  It is the cmd.exe that expands the environment variables, ftp.exe doesn't understand them, so you have to use Tims solution (afaik - but then wdik?).

Mark
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 23

Expert Comment

by:Tim Holman
ID: 2615267
afaik ?
wdik ?

I'm probably missing something here...!

0
 
LVL 5

Expert Comment

by:carmine
ID: 2615502
'as far as i know' you're not missing anything. But then 'what do i know'?

Mark
0
 
LVL 23

Expert Comment

by:Tim Holman
ID: 2788265
I see...
btw - FTP's been around for nearly 30 years - the basics aren't going to change in a hurry !
0
 
LVL 23

Accepted Solution

by:
Tim Holman earned 100 total points
ID: 2919452
Anyone there ?
0
 
LVL 5

Expert Comment

by:carmine
ID: 2930920
nah...
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Deploying Windows 10 in MDT 18 68
virus question? 6 75
Disk Cleanup and Temporary Files 15 41
flash professional 3 11
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

803 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