how do i get a batch file to enter a password

October 20, 2010 at 10:47:58
Specs: Windows XP
hi i have created a batch file but it asks for the password for a command how do i get it to enter automatically for me? i put ASKS FOR PASSWORD where it prompts me you can see the batch file below. alos how can i log the progress of what it did?

C:
echo off
date /T > c:\encryption.log
time /T >> c:\encryption.log
cd \Program Files\Common Files\SAP Shared\Retail Systems
regsvr32 TWsecuritylib.dll -u
pause
regsvr32 TWsecuritylib.dll
pause
TWSecurityPassUtil
ASKS FOR PASSWORD
pause
TWSecurityInstall -createcontainer -appname TWGM
ASKS FOR PASSWORD
pause
TWSecurityInstall -createchannel -appname TWGM -channelid APP
ASKS FOR PASSWORD
pause
TWSecurityInstall -createproperty -appname TWGM -token XPS_DBPW -value DBS$sqladmin
ASKS FOR PASSWORD
pause
TWSecurityInstall -createproperty -appname TWGM -token EJV_DBPW -value DBS$sqladmin
ASKS FOR PASSWORD
pause
TWSecurityInstall -createproperty -appname TWGM -token SM_DBPW -value DBS$sqladmin
ASKS FOR PASSWORD
pause
TWSecurityInstall -import -appname TWGM -keyfile C:\testkey.key
ASKS FOR PASSWORD
pause
TWSecurityInstall -createmapping -appname TWGM -channelid APP -token DEA7DB6D-A62D-4A8C-8D6E-996B3BA0E6EA
ASKS FOR PASSWORD
pause
TWSecurityInstall -updatekey -appname TWGM -token DEA7DB6D-A62D-4A8C-8D6E-996B3BA0E6EA -status AC
ASKS FOR PASSWORD
pause
cd \program files\sap\transnet
bin\twCreateContainer.bat
pause
java -classpath "lib\tncore.jar;lib\tw-security.jar;lib\logging.jar" com.triversity.transnet.core.twsecurity.TNSecurityFactory TWSecurityAdmin DBS$admin
ASKS FOR PASSWORD
pause
bin\twChgProperty.bat maskAllButLastFour true
pause
bin\twImportKeys c:\testkey.key
pause
java -classpath "lib\tw-security.jar" com.triversity.security.service.TWInstall -appname Transnet -create mapping -channelid APPLICATION -token DEA7DB6D-A62D-4A8C-8D6E-996B3BA0E6EA
ASKS FOR PASSWORD
pause
java -classpath "lib\tw-security.jar" com.triversity.security.service.TWInstall -appname Transnet update key -token DEA7DB6D-A62D-4A8C-8D6E-996B3BA0E6EA -status AC
ASKS FOR PASSWORD
date /T >> c:\encryption.log
time /T >> c:\encryption.log


See More: how do i get a batch file to enter a password

Report •


#1
October 20, 2010 at 15:25:50
You can't. You have to edit the batch file's contents. ie. remove the lines asking for the password.

Can I put a question here?


Report •

#2
October 21, 2010 at 06:08:28
i put "ASK FOR PASSWORD" to let you know when it promtps for a password
i dont have that actually in the batch file.

Report •

#3
October 21, 2010 at 12:18:45
I'm aware...
Right click the batch file > Edit > Look for lines similar to:

SET /p password:Enter the Password:
IF "%password%"=="PASSWORD" GOTO Next
EXIT

It might be a little different depending on the preferences of the creator.

I'm a little hesitant to directly show you, as there is probably a reason for the password...

Can I put a question here?


Report •

Related Solutions

#4
October 21, 2010 at 15:24:11
It looks to me that the TWSecurityInstall and TWSecurityPassUtil applications are causing the password prompt. If you check the available switches for those utilities (TWSecurityPassUtil /?) do you see anything that mentions passing the password?

Report •

#5
October 21, 2010 at 15:54:59
Ahh... Viddywell might very well be correct.

My apologies, I didn't pay attention to the commands in use. Sorry.

Can I put a question here?


Report •

Ask Question