Wrox Programmer Forums
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 5th, 2011, 08:44 PM
Registered User
Join Date: Mar 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Code Help

A fellow faculty member sends me this request to help her write a script for her class since I have written script for her previously for her this one in ? is way out of my league and am looking for some great help from you all.

Your dear friend Edwina would like an interactive file copy utility created. Since Edwina knows you are the master of the command line script file, she has come to you for a solution. She would like the command line to require the source folder to be entered with the command name. The existence of a command line parameter and the existence of the folder it’s supposed to represent should be checked. The script should then prompt the user for the name of the file that is to be copied from that folder. Check to make sure the file entered exists in the folder. If it does not, warn the user and ask if they want to copy another file. If they say no, display the results outlined below and quit. If they say yes, loop back and get another file name. Once the existence of the file within that folder is verified, the script should prompt the user for a destination folder. If the folder does not exist, the script should prompt the user asking if the folder should be created. If the user says no, nothing more should be done for that file. If the user says yes, the new folder should be created and the file should be copied. If the folder does exist, the script should check to see if the file is already in that folder. If it isn’t, just copy the file to the folder. If the file does exist, ask the user for permission to overwrite it. If they say yes, overwrite the file. If they say no, do nothing with that file. Regardless of what’s been done with the file, you should ask the user if they would like to copy another file from the folder. If they say yes, loop back and ask for another file name. If they say no, display a count of the number of files that were copied and the number of folders that the command created. The syntax you and Edwina finally agreed upon is shown below.

icopy source_folder


icopy c:\myfolder\data

Once icopy starts execution, it should first check for the existence of the folder c:\myfolder\data. A flowchart is attached at the end of this document to help you with the logic.
Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to save html page source code? Jaymond Flurrie Access VBA 2 July 2nd, 2019 06:04 PM
Double clicking control does not add code to Code Behind Paul Walton BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 5 September 25th, 2009 05:40 PM
Urgent:hard disk serial code and vb code ivanlaw Pro VB 6 0 July 25th, 2007 04:05 AM
VB: .Exe file, serial code and activation code ivanlaw Pro VB 6 8 July 6th, 2007 05:44 AM
Writing Client Side Script from Code-Behind code sajid_pk Classic ASP Databases 1 January 18th, 2005 12:53 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.