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


Batch File - how to embed username & password

Batch File - how to embed username & password

Batch File - how to embed username & password


I am trying to create a batch file which autmotically executes an evacuation list program located on a server. (Basically I will drop the batch file onto our fire wardens pcs and in the event of a fire any one of them can print off a list of who is in the building...)

I'm not very good with batch files.. I have called the program which opens up with a logon screen and login button.  I want to use commands in the batch file which will autmoatically login using username and password to this program without need for any user intervention, can this be done??  

I appreciate any advise, I'm off on 22-Jan so will not be able to reply to any posts until 23rd.

Many Thanks,

RE: Batch File - how to embed username & password

Without some fancier coding than I would be able to advise on, I would think that the program you're calling up has to support auto-filling of those fields in the syntax.  From a dos prompt, type:

{program path and name} /?
(without the brackets)

This should give you a list of the commands you can add to your batch file command.  Hopefully, there are commands for adding the username and password like:

c:\program.exe /u=username /p=password

Unfortunately, the exact syntax is unique to the program, so that's the best example I can give you.  Hope this helps.

RE: Batch File - how to embed username & password


Thanks for your advice but I'm afraid I couldn't get a list of commands using the /? as described above. I kept getting a popup error message from the application which included the following line:

exception message : GetProcAddress for MAPI.DLL function(s) failed

I'm not sure whats happening, the system I am trying to logon to using the batch file is called Mitrefinch Time Management System?? Maybe its just not meant to be!

RE: Batch File - how to embed username & password

Think about what you're asking for.

You want to put a plain text file (which is what a batch file is) on many computers.  There, anyone with access to the computer can open the file using, say, Notepad, and discover the plaintext userid/password for your time managment system.  

Don't you see any problem with that?

RE: Batch File - how to embed username & password

Administrators have significant permissions on a domain to perform numerous tasks and could possible cause havoc in the wrong hands.  

To be more blunt about this than harebrain, this is a HUGE security risk and ill-advised at best.

There is no built in command to windows that will accept a username AND a password in a batch file because of this security risk.  (Except Net Use, but that's only for accessing network shares).

If the application doesn't support something specific, you would need a third party app to do this.

RE: Batch File - how to embed username & password

Hi guys, thanks for your comments and help, I wasn't actually going to use an administrator password in the batch file I was going to setup one specific user account on the time management system and enable it to run one single report only, I understand the importence of security, and would not use an administrator password like that.. I think I will contact the people that created the system and see if they can help, thanks again for your help..

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