Solved

FTP Script

Posted on 2000-03-13
8
174 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Please help me Blue screen window 10 7 67
sql server service accounts 4 42
Disk Quota Windows 2012 R2 6 97
Password manager for small company 3 33
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
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.

839 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