Windows Scripting
  Home arrow Windows Scripting arrow Page 4 - Using FTP in WSH
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Using FTP in WSH
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2007-08-13

    Table of Contents:
  • Using FTP in WSH
  • Creating the Unattended FTP script
  • Putting the WSH script together
  • Security considerations when using unattended ftp scripts

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using FTP in WSH - Security considerations when using unattended ftp scripts


    (Page 4 of 4 )

    As you can see with this example, the username and password required for this ftp login are stored unencrypted in a plain text file. As you can imagine, this poses a potential security risk.

    It would be much safer if the user had to provide this information at the time of script execution. You could easily ask the user for a password using an input box, for example.

    strPassword = InputBox("Please enter the FTP password:", _

    "Enter Password")

    If you are launching this script from a command line, you might want to consider passing the password as an attribute to the script as I’ve done in the following example.

    If (WScript.Arguments.Count > 0) Then

    Set colArgs = WScript.Arguments

    strPassword = colArgs.Item(0)

    Else

    strPassword = ""

    End If

    Whatever way you choose to do for this, keep in mind that you never know when you’ll be dealing with prying eyes and, unfortunately, WSH scripts are stored in plain text format.

    Also, keep in mind that you are writing the FTP password to a temporary plain text file as well. Make sure that the temporary file is deleted immediately after the FTP command completes.

    In any case, I hope I’ve opened up the doors for you to add ftp functionality to your scripts. This can provide a very dynamic aspect to your scripting repertoire. Until next time, keep coding!


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Hey, guys. I'm making my return to Windows Scripting with this workaround for a...
     

    WINDOWS SCRIPTING ARTICLES

    - Introducing Two-Way Data Binding using Silve...
    - Silverlight 2.0 Application Development with...
    - Burning Multisession CDs with IMAPI2 in WSH
    - Creating a Silverlight 2.0 Application that ...
    - Burning CDs with the IMAPI2 Control
    - Burning CDs in Windows XP with WSH
    - Advanced Word Object Scripting
    - Reading and Printing Word Documents in WSH
    - Scripting Microsoft Word
    - Using WSH to Catalog MP3 Files
    - Reading MP3 ID3 Tags in WSH
    - A Brief Look at Menus in WPF
    - More Examples of Simplified Image Processing...
    - Completing a WPF To-Do List Application
    - Simplified Image Processing in GDI+





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT