tags:

views:

159

answers:

2

Please help me to acheive the following using VBScript

1.Messagebox with three tabs Copy,Update,Cancel and displaying "Welcome to the AVG

definition fies copier/updater module.Click on Copy to copy files or Update to update

definition files.

2.If copy selected,the drive letter from where the script is run(usb drive) stored as

variable,directory "(usb drive)Update" created if not exist,new and files not existing

in update folder copied to(eg=xcopy /d), from

"%allusersprofile%\applic~1\avg8\update\download"

3.If possible display message 'copying files, while copying.After completion of

copying display 'Files copied successfully'.

4.If update selected,tdirectory "c:\Update" created if not exist,new and files not

existing in "c:\Update" copied to, from (usb drive) update folder

5.If possible display message 'Updating files' while copying.After completion of

updating, display 'Files Updated successfully'.After clicking OK exit and start

"C:\progra~1\avg\avg8\avgui.exe"

A: 

Well, the way that I would do it is to make stand alone functions for each of the functional tasks that you have then wrap those functions inside an HTA to give you the interface layer that you want.

EBGreen
A: 

As I understand from your other question, you managed to find solutions to most of these tasks yourself. Here's a tip for your #2, which I haven't noticed implemented in that your script.

2.If copy selected,the drive letter from where the script is run(usb drive) stored as variable

You can retrieve the full path of the current script file using the WScript.ScriptFullName property and then use the FileSystemObject.GetDriveName method to extract the drive letter:

Set objFSO = CreateObject("Scripting.FileSystemObject")
strUSBDrive = objFSO.GetDriveName(WScript.ScriptFullName)

This will give you the drive letter followed by a colon (e.g. J:). You can then concatenate this value with the target folder name to get the full path, e.g.:

MsgBox strUSBDrive & "\Update"
Helen