Password Question

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
fatal.lordes
Posts: 5
Joined: 30 Mar 2010 18:07

Password Question

#1 Post by fatal.lordes » 14 Apr 2010 21:45

Hi All

I'm writing a batch file that basically is a menu of the command lines of heaps of functions that we use often, such as CMD, shutdown remote PC, open remote event viewer, get mac from IP, ping, etc. Most of these commands use the RUNAS function, which is great. And the menu is working great but I'd like to do one more tweak to it which is having to enter the username and password only once and then each of the command lines using the original username and password we entered for that current session.

For example, I start the batch file, enter my username and password as variables and then each menu item I select and run, it knows to always use that username and password. But when I close the batch file, the username and password are no longer remembered.

Is this possible? Do you follow what I mean? I still want to manually have to type in a username and password and I don't want to permanently store them anywhere, but I'm just keen to not have to type them in each time I do any of the menu items. I've worked out how to do the username as a variable, but the password is a lot more difficult as I don't believe RUNAS can do what I'm after... so is there something else that can?

Anyway, if anyone can help, I would really appreciate it.

Thanks.

Post Reply