function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Philip CarelsPhilip Carels 

dataloader commandline: save encrypted password to file

Hi all,
is it possible to run the password encryption tool and save the result to a file?
Currently I use:
cd C:\SFDC\CHECK\Dataloader\bin 

encrypt.bat -e <password> "C:\SFDC\CHECK\Dataloader\key.txt" >..\encryptedPassword.txt
The resulting file contains
2016-03-24 12:51:22,701 INFO [main] security.EncryptionUtil main (EncryptionUtil.java:365) - <encrypted password>

Is it possible to only save the <encrypted password>?

Thanks in advance!
Best Answer chosen by Philip Carels
LinThawLinThaw
Thanks Philip,

I also created a bat file to solve it.
Same logic with you!

like this,

for /f "tokens=*" %%A in ('encrypt.bat -g test123) do for %%B in (%%A) do echo %%B> %pathSfdcKeyFile%

Regards,
LinThaw.

All Answers

LinThawLinThaw
Hi Philip,

Have you got the answer about that?
    >> Is it possible to only save the <encrypted password>?
If you got that please share me.

Regards,
LinThaw.
Philip CarelsPhilip Carels
Hi LinThaw, 

I run the password encryption tool out of excel, because it integrates into a larger tool. 
I split the result from above in space and place all parts into an array. 
The last array item then is the hashed password. 
I then overwrite all content of the file with the password. 
 
Set filestream = fso.OpenTextFile(ActiveWorkbook.path & "\key.txt", forReading)
contents = filestream.readAll()

Dim Arr
Arr = Split(Trim(Application.Clean(contents)), " ")
getHashedPassword = Arr(UBound(Arr))

filestream.Close

Set filestream = fso.opentextfile(ActiveWorkbook.path & "\key.txt", ForWriting)
filestream.Write (getHashedPassword)
filestream.Close

Hope this helps.

Best regards,

Philip
LinThawLinThaw
Thanks Philip,

I also created a bat file to solve it.
Same logic with you!

like this,

for /f "tokens=*" %%A in ('encrypt.bat -g test123) do for %%B in (%%A) do echo %%B> %pathSfdcKeyFile%

Regards,
LinThaw.
This was selected as the best answer