How to run an interactive batch file on windows from a service?

Command Prompt windows 7 batch file password problem?

  • Hello I'm creatung a batch file for a windows 7 computer that when run will start up command prompt in administrator mode, I have gotten so far as the user is then promted to enter the CMD password, I have this password but I was wondering if there was a way for the pass word to be entered automatically so the user would not have to enter it?

  • Answer:

    That kind of defeats the purpose of having a password, but ok. Let's say you kept your password "Password" in a text file called "%username%.pwd Here's the code: echo off cls set /p Username=Username: Set CorrectPW=Password :Begin cls if not exist "%username%.pwd" set /p Password=Password: if exist "%username%.pwd" set /p Password=< "%username%.pwd" if /i %Password%==%CorrectPW% goto LoggedIn if /i NOT %Password%==%CorrectPW% goto Begin :LoggedIn cls Echo Username: %Username% echo Password:%Password%

Patrick d at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.