Solved

Set values in other program

Posted on 2006-11-29
2
186 Views
Last Modified: 2010-08-05
Hi experts,

I have a 3rd party program that starts up from a shortcut, the first window it’s a logging screen  now my question is it possible to write a scrip or program to run the shortcut and set the values for the user and password?. and how can it be done?

Thanks.
0
Comment
Question by:Stendor
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 400 total points
ID: 18037808
Sure it's possible...the only thing in question is how much work needs to be done.

At it's simplest you could do:

    (1) Process.Start()
    (2) Process.WaitForInputIdle()
    (3) SendKeys.Send() ' UserName
    (4) SendKeys.Send() ' Tab to move to next Field
    (5) SendKeys.Send() ' Password
    (6) SendKeys.Send() ' Enter

Here is an example using NotePad:

        Dim p As Process = Process.Start("notepad")
        p.WaitForInputIdle()
        SendKeys.Send("Bond")
        SendKeys.Send("{Tab}")
        SendKeys.Send("007")
        SendKeys.Send("{Enter}")

It often gets more complicated than that though.  Sometimes you need to use APIs to look for the presence of the "login" window.  Other times you have to explicitly give a window/control focus.  I've seen some situations where SendKeys.Send() doesn't work and you have to either use APIs to simulate keyboard input directly or send the info the controls directly with SendMessage().   etc....
0
 
LVL 1

Author Comment

by:Stendor
ID: 18038083
Thanks a million Idle Mind
very good and fast answer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now