473,659 Members | 3,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.SendWa it("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 .SecurityExcept ion: 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 RedirectStandar dInput (code below), but this did not work
at all.

Dim p As New Process
p.StartInfo.Fil eName = "unrar.exe"
p.StartInfo.Arg uments = "e D:\temp\key.rar D:\temp2"
p.StartInfo.Use ShellExecute = False
p.StartInfo.Red irectStandardIn put = True
p.Start()
p.StandardInput .WriteLine("tes t")
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 2025

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

Similar topics

17
2891
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 them, otherwise please forgive the crossposting.) I'm sure I've seen posts here before criticising the practice of automating outlook for the purpose of programatically sending email, on the grounds that it's naff. Well now we're really landed in...
3
1263
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 e-mail) using VBA. However, I was wondering if this is a mistake in performance measures. It is a small app with under 10 users but I would like it to be scalable and as efficient as possible. Are there better methods than creating an outlook...
3
3108
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 program only works for the domain I am currently logged into. If I try to query a machine on another domain I get "permission denied". So I have to log out and log back in to the other domain. I recently used a program that added users to a...
7
1355
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 and then attempt to update it, the program will ask for a password. My question is, how can I go about doing this? I can create a string variable and set it to something for the password, and then check the user's input against this password value,...
4
3129
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 getting a SMTP script running. While the Drupal feedback module and the new account creation works fine in terms of sending of mails, I am having some problems with the sending of password reminder emails. warning: Cannot modify header information -...
3
1980
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
1909
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 unhash it to pass to windows for authentication? Or can I set something in Web.Config that will do that? I haven't found any documentation that points me to what to do next.
0
992
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 the user will b prompt to type in his/her email address and if his/her email is found in the database, it will send his/her username and password to that email.
2
2678
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 to be created) as a parameter * forgotPassword, using whatever arguments it needs -- uses sendEmail to send lost password to user * sendRegistrationInfo, using whatever arguments it needs -- uses
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8337
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8628
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.