• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

Need to Open App1 By Opening App2 Only

I made a updater that looks to server to see if any files are needed and updates them then once done it loads app2. Is their a way when user runs app2 it will not load or redirect them to app1. I was using ini & registry but we would get power/ user failure and I would have to go and change it as it was to much of hassle.
1 Solution
Mike TomlinsonMiddle School Assistant TeacherCommented:
One possibility is to pass a password from the updater to the main app via command line parameters.  In the main app, if the password is not present in the command line parameters then you know it was executed directly by the user.

Something like...

Private Sub Form_Load()
    Dim cmd As String
    cmd = Trim(Command())
    If cmd <> "password" Then
        MsgBox "Please run the updater"
        Unload Me
    End If
End Sub
thaburnerAuthor Commented:
Thats a good idea I just tried it and it works like I need it. Thanks Idle

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now