Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Startup Multiple Sessions

Startup Multiple Sessions

Startup Multiple Sessions

Find Session1 or whatever your session names are, usually in
C:\Program Files\Attachmate\Sessions\Session1.edp
Right Click on it and choose Send to - then Desktop, which creates
a shortcut on the desktop if you don't already have one.  I drag the
shortcut from the desktop to my windows tool bar so it's always handy.
Next, Edit Session1.edp in the Sessions Folder.  
Right click and choose "open with" and choose
"Macro Editor application".  You may have to search for it.

After you open Session1.edp look for the StartupScript line under

Enter C:\Program Files\Attachmate\Macros\Session1.ebm
Should look like:
StartupScript=C:\Program Files\Attachmate\Macros\Session1.ebm
'or wherever your macros are
'This calls macro Session1.ebm

Save the file and close.

Create macro Session1 as you would any other macro.
It has to be in the same path as the StartupScript.
i.e. C:\Program Files\Attachmate\Macros\Session1.ebm

' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$

Sub Main()
' Get the main system object
    Dim Sessions As Object
    Dim System As Object
    Set System = CreateObject("EXTRA.System")    ' Gets the system object
    If (System is Nothing) Then
        Msgbox "Could not create the EXTRA System object.  Stopping macro playback."
    End If
    Set Sessions = System.Sessions

    If (Sessions is Nothing) Then
        Msgbox "Could not create the Sessions collection object.  Stopping macro playback."
    End If
' Set the default wait timeout value
    g_HostSettleTime = 1000        ' milliseconds

    OldSystemTimeout& = System.TimeoutValue
    If (g_HostSettleTime > OldSystemTimeout) Then
        System.TimeoutValue = g_HostSettleTime
    End If

' Get the necessary Session Object
    Dim Sess0 As Object
    Set Sess0 = System.ActiveSession
    If (Sess0 is Nothing) Then
        Msgbox "Could not create the Session object.  Stopping macro playback."
    End If
    If Not Sess0.Visible Then Sess0.Visible = TRUE

' This section of code contains the recorded events

' All of the sendkeys should match however you navigate
' once the session is started. (i.e. navigating through
' startup screens.
        pause 1
Use a password box if you if you have security issues.
    Sess0.Screen.Sendkeys("YourLogin Your Password<Enter>")    

        Sendkeys "%FOSession2" 'THIS FIRES UP Session2 which calls the Session2 Macro "and so on"
        Sendkeys "{Enter}"      

    System.TimeoutValue = OldSystemTimeout
End Sub

Each Session.edp needs to be edited "StartupScript=" to point to the Session.ebm Macro
Use whatever your Session names are.
Once you click on your shortcut to session1 all the other sessions will fire up one right after the other.
I use 4 Sessions so each session calls the the next one.

RE: Startup Multiple Sessions

Enter C:\Program Files\Attachmate\Macros\Session1.ebm
Should look like:
StartupScript=C:\Program Files\Attachmate\Macros\Session1.ebm


Enter C:\Program Files\Attachmate\Sessions\Session1.ebm
Should look like:
StartupScript=C:\Program files\Attachmate\Sessions\Session1.ebm  

RE: Startup Multiple Sessions

Never mind I had it right the first time.

Enter C:\Program Files\Attachmate\Macros\Session1.ebm
Should look like:
StartupScript=C:\Program \files\Attachmate\Macros\Session1.ebm

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close