Sign in to follow this  
Followers 0
Barry

ProgressBar

6 posts in this topic

Hi all.

Is there any way to compile a progressbar that can be called from other scripting program such vbs.

Share this post


Link to post
Share on other sites



Hi all.

Is there any way to compile a progressbar that can be called from other scripting program such vbs.

Welcome to the forum. Could you possibly provide an example? For example, do you envision launching a program from VBS that has a progress bar control in it and then updating the progress bar as your script runs? Is there a reason that you are not doing the entire task from AutoIt?

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

The main purpose is that the login script that run all user call a progress bar with details of the day, logon server, map drives with progress, and at the end of the login script close the progress bar.

Here are the two file I'm trying to use whitout success.

Option Explicit

Dim objLP, InitLogonprogressOK

InitLogonprogressOK = False

Dim WshNetwork, fso, GroupDict, WshShell, blIsNewBusy, oUser

Set WshShell= WScript.CreateObject("WScript.Shell")

Set WshNetwork = WScript.CreateObject("WScript.Network")

Set fso = CreateObject("Scripting.FileSystemObject")

oUser = WshNetwork.UserName

Main

Sub Main

On Error Resume Next

InitLogonprogress

InfoLogonprogress 0 , ""

WScript.Sleep 1000 ' 1/10 th of a second

InfoLogonprogress 10 , ""

WScript.Sleep 1000 ' 1/10 th of a second

If IsMember("ES_General") Then

WSHNetwork.MapNetworkDrive "R:", "\\SERVER\refresco"

End If

InfoLogonprogress 15 , ""

WScript.Sleep 1000 ' 1/10 th of a second

If IsMember("ES_General") Then

WSHNetwork.MapNetworkDrive "S:", "\\SERVER\SHARED"

End If

InfoLogonprogress 20 , ""

WScript.Sleep 1000 ' 1/10 th of a second

If IsMember("ES_General") Then

WSHNetwork.MapNetworkDrive "H:", "\\SERVER\" & strusername & "$"

End If

InfoLogonprogress 25 , ""

WScript.Sleep 1000 ' 1/10 th of a second

If IsMember("ES_General") Then

WSHNetwork.MapNetworkDrive "P:", "\\SERVER\PROGRAMS"

End If

InfoLogonprogress 30 , ""

WScript.Sleep 1000 ' 1/10 th of a second

If IsMember("ES_General") Then

WSHNetwork.MapNetworkDrive "N:", "\\SERVER\BANCA"

End If

InfoLogonprogress 35 , ""

WScript.Sleep 1000 ' 1/10 th of a second

InfoLogonprogress 40 , ""

WScript.Sleep 1000 ' 1/10 th of a second

InfoLogonprogress 50 , ""

WScript.Sleep 1000 ' 1/10 th of a second

InfoLogonprogress 55 , ""

WScript.Sleep 1000 ' 1/10 th of a second

InfoLogonprogress 60 , ""

WScript.Sleep 1000 ' 1/10 th of a second

InfoLogonprogress 65 , ""

WScript.Sleep 1000 ' 1/10 th of a second

InfoLogonprogress 75 , ""

WScript.Sleep 1000 ' 1/10 th of a second

InfoLogonprogress 80 , ""

WScript.Sleep 1000 ' 1/10 th of a second

InfoLogonprogress 85 , ""

WScript.Sleep 1000 ' 1/10 th of a second

InfoLogonprogress 90 , ""

WScript.Sleep 1000 ' 1/10 th of a second

'If IsMember("GRP LG HQ HQPRT005") Then

' WshNetwork.AddWindowsPrinterConnection HQPRT005

'End If

InfoLogonprogress 95 , ""

WScript.Sleep 1000 ' 1/10 th of a second

End Sub

InfoLogonprogress 100 , ""

WScript.Sleep 1000 ' 1/10 th of a second

CloseLogonprogress

WScript.Quit()

Function IsMember(sGroup)

Dim sAdsPath, oUser, oGroup

If IsEmpty(GroupDict) Then

Set GroupDict = CreateObject("scripting.Dictionary")

Set WshNetwork = WScript.CreateObject("WScript.Network")

GroupDict.CompareMode = vbTextCompare

sAdsPath = WshNetwork.UserDomain & "/" & WshNetwork.UserName

Set oUser = GetObject("WinNT://" & sAdsPath & ",user")

For Each oGroup In oUser.Groups

GroupDict.Add oGroup.Name, "-"

Next

Set oUser = Nothing

End If

isMember = CBool(GroupDict.Exists(sGroup))

End Function

Sub InitLogonprogress ()

Err.Clear

On Error Resume Next

Dim fso, WshProcEnv, WshShell

Set fso = CreateObject("Scripting.FileSystemObject")

Set WshShell=WScript.CreateObject("WScript.Shell")

Set WshProcEnv=WshShell.Environment("PROCESS")

If Not fso.FileExists ( WshProcEnv("U:\Privado\scripts\ProgressBar\Prueba1.exe" ) Then Exit Sub

Set objLP = CreateObject("logonprogress.application")

If Err.Number <> 0 Then Exit Sub

objLP.ShowScreen = 1

objLP.Bartype = 0

objLP.title = "Powered By Information Technology"

InitLogonprogressOK = True

End Sub

Sub InfoLogonprogress ( Position, Description )

On Error Resume Next

If InitLogonprogressOK Then

Description = "Logon script is processing, one moment please..."

objLP.Bar = Position

objLP.Description = Description

End If

End Sub

Sub CloseLogonprogress ( )

On Error Resume Next

If InitLogonprogressOK Then

objLP.ShowScreen = 0

objLP.Quit

Set objLP = Nothing

End If

End Sub

Prueba1.au3

Share this post


Link to post
Share on other sites

yep

you can

using the control progress bar registered in the system registry

My logon script at my firm shows a progress bar for users

i can send you an example when i'll be at work

c u

for now, look at the clsid controls and more

(the progress bar is shown through an internet explorer object)


-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]

Share this post


Link to post
Share on other sites

yep

you can

using the control progress bar registered in the system registry

My logon script at my firm shows a progress bar for users

i can send you an example when i'll be at work

c u

for now, look at the clsid controls and more

(the progress bar is shown through an internet explorer object)

Thanks a lot.

I've tried to do it too with IE, but as it use activeX it blocks the progress bar unless you permit activeX code. Am I right?.

Share this post


Link to post
Share on other sites

Hi,

Is anyone there than can help me?.

thanks in advance.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0