Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show user progress of script or what is going on.

Status
Not open for further replies.

neemi

Programmer
May 14, 2002
519
GB
I have the below script which I have inherited, but know nothing about vbscripting! all it does is copies a server version of a db to the client machine.

The code is activated via another db so when that application has quit and inbetween copying the server db and opening it, the machine looks like it is not doing anything. I wanted to somehow display some sort of messages of the progress and an hourglass. etc.

Can someone please help on how to edit this code and what to do.

Code:
If WScript.Arguments.Count = 4 Then
	sCentralCopy = Wscript.Arguments.Item(0)
	sLocalFolder = Wscript.Arguments.Item(1)
	sAppName = Wscript.Arguments.Item(2)
	sAppVersion = Wscript.Arguments.Item(3)
Else
	MsgBox "Incorrect number of Arguments - Upgrade failed"
	WScript.QUIT(0)
End If

Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.FileExists(sCentralCopy & sAppName & ".mdb") Then
    objFSO.CopyFile sCentralCopy & sAppName & ".mdb", sLocalFolder, True
    Call OpenAccess
Else
    Wscript.Echo "Central copy file does not exist."
    WScript.QUIT(0)
End If


Function OpenAccess()
	Select Case sAppVersion
		Case 9
				Set AcApp = CreateObject("Access.Application.9")
		Case 10
				Set AcApp = CreateObject("Access.Application.10")
		Case 11
				Set AcApp = CreateObject("Access.Application.11") 
		Case 12
				Set AcApp = CreateObject("Access.Application.12") 
	End Select
    AcApp.AutomationSecurity = 1
    AcApp.Visible = True
    AcApp.OpenCurrentDatabase sLocalFolder & "\" & sAppName & ".mdb"
    AcApp.UserControl = True
    Set AcApp = Nothing
End Function


Cheers
neemi
 
you script should be so fast that progress reports are pointless :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top