Solved

FTP Script

Posted on 2000-03-13
8
170 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
 
LVL 23

Expert Comment

by:Tim Holman
ID: 2615267
afaik ?
wdik ?

I'm probably missing something here...!

0
Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.

 
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

The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

Join & Write a Comment

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

21 Experts available now in Live!

Get 1:1 Help Now