Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch File - how to embed username & password

Status
Not open for further replies.

lorrscan

Technical User
Feb 16, 2007
28
0
0
IE
Hello,

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,
lorraine
 
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.
 
Hi MMSMSD,

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!
 
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?
 
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.
 
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..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top