Solved

FTP Script

Posted on 2000-03-13
8
175 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
[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
  • 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

An article on effective troubleshooting
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
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.

726 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