Hi Guys,
Im having trouble getting a progress bar working in my script.
I have only just started scripting so im not 100% sure on alot of things.
Here is my script:
***************************************************************
'MESSAGE BOX WITH YES OR NO ANSWER
If msgbox ("This will backup your data" &vbnewline& "are you sure you want to continue?" , vbYesNo, "Backup Data Now") = vbYes Then
'USE FILE SYSTEM OBJECT TO COPY FILES
'*****WORK FOLDER*****'
Dim FSO
force = true
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFolder "C:\Users\It support\Desktop\sarah's", "C:\Users\It support\Desktop\test\" , force
TestCondition = 0
Else
msgbox "Backup not completed"
End If
*******************************************************
Here is the progress bar i want to include:
*******************************************************
TestCondition = ""
stage = 1
Do
If stage > 0 Then
stage = DisplayProgress(stage)
End If
Loop While TestCondition = ""
Function DisplayProgress(stage)
'Here is a phony progress bar that uses an IE Window
set x = createobject("internetexplorer.application")
'in code, the colon acts as a line feed
x.navigate2 "about:blank" : x.width = 350 : x.height = 80 : x.toolbar = false : x.menubar = false : x.statusbar = false : x.visible = True
x.document.write "<font color=blue>"
For n = 1 to 100
x.document.write "|"
wscript.sleep 50
x.document.title = "Stage " & stage & " " & n & " %"
Next
stage = stage + 1
'close the window
x.quit
set x = nothing
DisplayProgress = stage
End Function
********************************************************
When i try to get the progress bar working inside my script, it just loops the bar and wont goto the next step of the script. or it only does the Progress bar once.
I cannot get it to work no matter what i try.
Im having trouble getting a progress bar working in my script.
I have only just started scripting so im not 100% sure on alot of things.
Here is my script:
***************************************************************
'MESSAGE BOX WITH YES OR NO ANSWER
If msgbox ("This will backup your data" &vbnewline& "are you sure you want to continue?" , vbYesNo, "Backup Data Now") = vbYes Then
'USE FILE SYSTEM OBJECT TO COPY FILES
'*****WORK FOLDER*****'
Dim FSO
force = true
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFolder "C:\Users\It support\Desktop\sarah's", "C:\Users\It support\Desktop\test\" , force
TestCondition = 0
Else
msgbox "Backup not completed"
End If
*******************************************************
Here is the progress bar i want to include:
*******************************************************
TestCondition = ""
stage = 1
Do
If stage > 0 Then
stage = DisplayProgress(stage)
End If
Loop While TestCondition = ""
Function DisplayProgress(stage)
'Here is a phony progress bar that uses an IE Window
set x = createobject("internetexplorer.application")
'in code, the colon acts as a line feed
x.navigate2 "about:blank" : x.width = 350 : x.height = 80 : x.toolbar = false : x.menubar = false : x.statusbar = false : x.visible = True
x.document.write "<font color=blue>"
For n = 1 to 100
x.document.write "|"
wscript.sleep 50
x.document.title = "Stage " & stage & " " & n & " %"
Next
stage = stage + 1
'close the window
x.quit
set x = nothing
DisplayProgress = stage
End Function
********************************************************
When i try to get the progress bar working inside my script, it just loops the bar and wont goto the next step of the script. or it only does the Progress bar once.
I cannot get it to work no matter what i try.