473,324 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Sending a password to another program?

Hello, how can I make a program respond to another program's input request?

For example, this code:

Process.Start("unrar.exe", "e D:\temp\key.rar D:temp2")
SendKeys.SendWait("test~")

will successfully start a program that prompts for a password, and then
submit the password via SendKeys. SendKeys will work with both console and
windows prompts. However, the program only works when is executed by
someone currently logged on in the computer. If you schedule the program to
run when nobody is logged on, the program will fail, I think, because now
window is displayed for the SendKeys function to send the password. This is
the error the program logs when this happen:

System.Security.SecurityException: Unable to create Hook.
at System.Windows.Forms.SendKeys.InstallHook()
at System.Windows.Forms.SendKeys.Send(String keys, Control control,
Boolean wait)
etc, etc,

I also tried with RedirectStandardInput (code below), but this did not work
at all.

Dim p As New Process
p.StartInfo.FileName = "unrar.exe"
p.StartInfo.Arguments = "e D:\temp\key.rar D:\temp2"
p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardInput = True
p.Start()
p.StandardInput.WriteLine("test")
p.StandardInput.Close()
p.WaitForExit()
p.Close()

This code does not cause an error, but the program replies that an incorrect
password was entered.

Could anyone please help, I need to be able to start a program at boot time.
The program requires a password, but does not provide a command line option
for it.

Any help will be greatly appreciated.

federico
Nov 20 '05 #1
0 2011

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Bonj | last post by:
Right guys. (I would like a solution to this in VB6 as this is what our needy app is written in, but any solutions that involve .NET would be much appreciated likewise as I could instantiate...
3
by: Ivan Weiss | last post by:
I have an application where employees fill out forms and they are e-mailed to the responsibility party once completed. I was planning on using Microsoft Outlook (since everyone uses it for office...
3
by: Terry Olsen | last post by:
I have administrator access on 2 different domains on the network at my job. I wrote a program to query the registry key on remote PC's and return the results to an excel spreadsheet. However, the...
7
by: Stanav | last post by:
Hello all, I'm writing a program that interacts with databases. I want that when the users run this program, they can view the data as much as they want. But if they make any changes to the data...
4
by: splicemix | last post by:
Hi all, I have recently set up a Drupal website. I am a beginner. My shared host server does not allow nobody@localhost to send emails, and prevents access to php.ini, so I spent some time...
3
by: mfleet1973 | last post by:
Hello Again. I have a program that sends e-mails as follows: Try Dim mail As New MailMessage mail.To = "me@comp.com" mail.From = "me@comp.com mail.Subject = "Test" mail.Body = "Testing123"
5
by: =?Utf-8?B?Sm9l?= | last post by:
I need to store a password for use later in my web app and I would like to use FormsAuthentication.HashPasswordForStoringInConfigFile. The question is, once it's hashed and stored, do I need to...
0
by: gyap88 | last post by:
I am currently using vb 2005. I have 3 columns in my database. One containing all the email address,another containing usernames, another containing password. My program has this button whereby...
2
by: Allie | last post by:
Hi, all. I'm new to C# programming. I'm even newer to programming email capabilities into my code. What I need to do is create three (3) functions: * sendEmail, using a Mail object (which needs...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.