[SOLVED] Prompt to enter password
Moderator: DosItHelp
[SOLVED] Prompt to enter password
:META
"%PROGPATH%\unrar" e -o+ "%PROGPATH%\all.rar" "%PROGPATH%\" >NUL
IF %ERRORLEVEL%==0 FOR %%F IN ("%PROGPATH%\meta.txt") DO FOR /F %%D IN ("%%~tF") DO SET METAUP= meta always up-to-date.
GOTO Amenu
--------
The file "" all.rar "" protected by me with a password.
How do I customize the batch file so that first prompted to enter password.
"%PROGPATH%\unrar" e -o+ "%PROGPATH%\all.rar" "%PROGPATH%\" >NUL
IF %ERRORLEVEL%==0 FOR %%F IN ("%PROGPATH%\meta.txt") DO FOR /F %%D IN ("%%~tF") DO SET METAUP= meta always up-to-date.
GOTO Amenu
--------
The file "" all.rar "" protected by me with a password.
How do I customize the batch file so that first prompted to enter password.
Last edited by demmnic on 17 Aug 2012 01:36, edited 1 time in total.
Re: Prompt to enter password
a prompt in a batch for input is like this:
The password will be stored in the varibale %input%
But in your case you are using a program "unrar", it must have a switch to take the password like 7z it has the switch "-p password" so you have two choices,
1> you add the password switch in your code follwed by the password.
2> add the above code in your batch "at the begining" and also add the switch of the password but followed by this "%input%"
Code: Select all
Set /P "input=Enter Password: "
The password will be stored in the varibale %input%
But in your case you are using a program "unrar", it must have a switch to take the password like 7z it has the switch "-p password" so you have two choices,
1> you add the password switch in your code follwed by the password.
2> add the above code in your batch "at the begining" and also add the switch of the password but followed by this "%input%"
Re: Prompt to enter password
Edit by user
Last edited by demmnic on 15 Aug 2012 07:53, edited 1 time in total.
Re: Prompt to enter password
the changes is in red
I'm not sure if it will work or not if it didn't tell us
@echo off
cls
:: Prompt for password
Set /P "input=Enter Password: "
:::::::::::::::::::::::::::::: START MAP ACTIVATIE ::::::::::::::::::::::::::::::
:META
"%TEMP%\FastActivateMetaGet.exe" http://www.hallo.info/meta.rar /overwrite /output:"%PROGPATH%\meta.rar"
"%PROGPATH%\unrar" e -o+ -p "%input%" "%PROGPATH%\meta.rar" "%PROGPATH%\" >NUL
IF %ERRORLEVEL%==0 FOR %%F IN ("%PROGPATH%\meta.txt") DO FOR /F %%D IN ("%%~tF") DO SET METAUP=De geintegreerde meta is ten alle tijden up-to-date.
GOTO Amenu
:JUMPMAP
IF EXIST "%PROGPATH%\meta.txt" GOTO BACKBIF
IF NOT EXIST "%PROGPATH%\meta.txt" ECHO. & ECHO META.TXT niet gevonden! Voordat je gaat activeren eerst de meta.txt updaten! & ECHO. & PAUSE
IF NOT EXIST "%PROGPATH%\meta.txt" GOTO Amenu
:BACKBIF
IF EXIST \TTGO.ORI SET BIFFILE=TTGO.ORI
IF "%BIFFILE%"=="TTGO.ORI" GOTO JUMPBIF
IF EXIST \TTGO.BIF SET BIFFILE=TTGO.BIF
IF "%BIFFILE%"=="TTGO.BIF" GOTO JUMPBIF
IF EXIST \TTNAVIGATOR.BIF SET BIFFILE=TTNAVIGATOR.BIF
IF "%BIFFILE%"=="TTNAVIGATOR.BIF" GOTO JUMPBIF
:JUMPBIF
IF %BIFFILE%x==x ECHO. & ECHO TTGO.BIF of TTNAVIGATOR.BIF niet gevonden!! Kopieer TTIC_Activate.exe in de root van je Tomtom of SD kaart. & ECHO. & PAUSE
IF %BIFFILE%x==x GOTO Amenu
TYPE \%BIFFILE% | FIND "ApplicationVersionVersionNumber=" > %TEMP%\ApplicationVersionID.TXT
set /P ApplicationVersionID= < %TEMP%\ApplicationVersionID.TXT
IF "%ApplicationVersionID%x"=="x" GOTO APP1
rem ***** hiiteen 32 ekaa merkkii ja ota 10 vikaa *****
SET ApplicationVersionID=%ApplicationVersionID:~32,10%
GOTO APP2
:APP1
TYPE \%BIFFILE% | FIND "ApplicationVersion=" > %TEMP%\ApplicationVersionID.TXT
set /P ApplicationVersionID= < %TEMP%\ApplicationVersionID.TXT
rem ***** hiiteen 19 ekaa merkkii ja ota 10 vikaa *****
SET ApplicationVersionID=%ApplicationVersionID:~19,10%
:APP2
IF %ApplicationVersionID%==7451 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7910 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7915 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7916 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7917 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7918 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7900 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7903 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==8010 SET KEYTYPE=8 & GOTO JUMP
If 8010 LSS %ApplicationVersionID% SET KEYTYPE=8 & GOTO JUMP
SET KEYTYPE=7 & GOTO JUMP
GOTO END
:JUMP
IF EXIST mymeta.txt copy "%PROGPATH%\meta.txt" + mymeta.txt "%PROGPATH%\meta.txt" & GOTO MYMETAON
IF NOT EXIST mymeta.txt ren "%PROGPATH%\meta.txt" meta.txt
:MYMETAON
COPY /y "%PROGPATH%\meta.txt" %ROOTDIR% >NUL
TYPE \%BIFFILE% | FIND "DeviceUniqueID" > %TEMP%\DeviceUniqueID.TXT
set /P DeviceUniqueID= < %TEMP%\DeviceUniqueID.TXT
rem ***** valit hiiteen *****
SET DeviceUniqueID=%DeviceUniqueID: =%
rem ***** ota vikat 10 merkkii *****
SET DeviceID=%DeviceUniqueID:~-10%
TYPE \%BIFFILE% | FIND "DeviceName" > %TEMP%\DeviceNameID.TXT
set /P DeviceNameID= < %TEMP%\DeviceNameID.TXT
rem ***** hiiteen 11 ekaa merkkii ja ota 80 vikaa *****
SET DeviceNameID=%DeviceNameID:~11,80%
CLS
I'm not sure if it will work or not if it didn't tell us
Re: Prompt to enter password
Edit by user
Last edited by demmnic on 17 Aug 2012 01:29, edited 1 time in total.
Re: Prompt to enter password
There is no image there.
Re: Prompt to enter password
demmnic wrote:Download file going well.
See sample:
http://www.4youshared.info/sample.png
Then batch stopped before unpacking.
You know it is possible to copy and paste text from the cmd window.
Re: Prompt to enter password
edit by user
Last edited by demmnic on 15 Aug 2012 08:27, edited 1 time in total.
-
- Posts: 60
- Joined: 17 Mar 2012 09:59
Re: Prompt to enter password
Are you trying to activate a TomTom map using some sort of patch? 

Re: Prompt to enter password
Edit by user
Last edited by demmnic on 17 Aug 2012 01:32, edited 1 time in total.
Re: Prompt to enter password
Ok try removing the double qoutes here :
If didn't work then remove the space between "-p" and "%input%"
-p "%input%"
If didn't work then remove the space between "-p" and "%input%"
Re: Prompt to enter password
Sorry
Both options does not have any effect.
Both options does not have any effect.
Re: Prompt to enter password
ok first we will test it if it can take the password directlly from the batch use this
EDITED
I removed the space between the switch and the password
EDITED
I removed the space between the switch and the password
:META
"%TEMP%\FastActivateMetaGet.exe" http://www.hallo.info/meta.rar /overwrite /output:"%PROGPATH%\meta.rar"
"%PROGPATH%\unrar" e -o+ -ppassword "%PROGPATH%\meta.rar" "%PROGPATH%\" >NUL
IF %ERRORLEVEL%==0 FOR %%F IN ("%PROGPATH%\meta.txt") DO FOR /F %%D IN ("%%~tF") DO SET METAUP=De geintegreerde meta is ten alle tijden up-to-date.
GOTO Amenu
:JUMPMAP
IF EXIST "%PROGPATH%\meta.txt" GOTO BACKBIF
IF NOT EXIST "%PROGPATH%\meta.txt" ECHO. & ECHO META.TXT niet gevonden! Voordat je gaat activeren eerst de meta.txt updaten! & ECHO. & PAUSE
IF NOT EXIST "%PROGPATH%\meta.txt" GOTO Amenu
:BACKBIF
IF EXIST \TTGO.ORI SET BIFFILE=TTGO.ORI
IF "%BIFFILE%"=="TTGO.ORI" GOTO JUMPBIF
IF EXIST \TTGO.BIF SET BIFFILE=TTGO.BIF
IF "%BIFFILE%"=="TTGO.BIF" GOTO JUMPBIF
IF EXIST \TTNAVIGATOR.BIF SET BIFFILE=TTNAVIGATOR.BIF
IF "%BIFFILE%"=="TTNAVIGATOR.BIF" GOTO JUMPBIF
:JUMPBIF
IF %BIFFILE%x==x ECHO. & ECHO TTGO.BIF of TTNAVIGATOR.BIF niet gevonden!! Kopieer TTIC_Activate.exe in de root van je Tomtom of SD kaart. & ECHO. & PAUSE
IF %BIFFILE%x==x GOTO Amenu
TYPE \%BIFFILE% | FIND "ApplicationVersionVersionNumber=" > %TEMP%\ApplicationVersionID.TXT
set /P ApplicationVersionID= < %TEMP%\ApplicationVersionID.TXT
IF "%ApplicationVersionID%x"=="x" GOTO APP1
rem ***** hiiteen 32 ekaa merkkii ja ota 10 vikaa *****
SET ApplicationVersionID=%ApplicationVersionID:~32,10%
GOTO APP2
:APP1
TYPE \%BIFFILE% | FIND "ApplicationVersion=" > %TEMP%\ApplicationVersionID.TXT
set /P ApplicationVersionID= < %TEMP%\ApplicationVersionID.TXT
rem ***** hiiteen 19 ekaa merkkii ja ota 10 vikaa *****
SET ApplicationVersionID=%ApplicationVersionID:~19,10%
:APP2
IF %ApplicationVersionID%==7451 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7910 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7915 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7916 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7917 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7918 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7900 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==7903 SET KEYTYPE=8 & GOTO JUMP
IF %ApplicationVersionID%==8010 SET KEYTYPE=8 & GOTO JUMP
If 8010 LSS %ApplicationVersionID% SET KEYTYPE=8 & GOTO JUMP
SET KEYTYPE=7 & GOTO JUMP
GOTO END
:JUMP
IF EXIST mymeta.txt copy "%PROGPATH%\meta.txt" + mymeta.txt "%PROGPATH%\meta.txt" & GOTO MYMETAON
IF NOT EXIST mymeta.txt ren "%PROGPATH%\meta.txt" meta.txt
:MYMETAON
COPY /y "%PROGPATH%\meta.txt" %ROOTDIR% >NUL
TYPE \%BIFFILE% | FIND "DeviceUniqueID" > %TEMP%\DeviceUniqueID.TXT
set /P DeviceUniqueID= < %TEMP%\DeviceUniqueID.TXT
rem ***** valit hiiteen *****
SET DeviceUniqueID=%DeviceUniqueID: =%
rem ***** ota vikat 10 merkkii *****
SET DeviceID=%DeviceUniqueID:~-10%
TYPE \%BIFFILE% | FIND "DeviceName" > %TEMP%\DeviceNameID.TXT
set /P DeviceNameID= < %TEMP%\DeviceNameID.TXT
rem ***** hiiteen 11 ekaa merkkii ja ota 80 vikaa *****
SET DeviceNameID=%DeviceNameID:~11,80%
CLS
Last edited by abc0502 on 15 Aug 2012 11:57, edited 1 time in total.
Re: Prompt to enter password
I was searching about the tool "unrar" it seems that it has problem with protected archives
is it ok to use the 7zip instead of the unrar to extract the files
is it ok to use the 7zip instead of the unrar to extract the files