I have a sol contract and I want to vote through truffle,but I want to try to do it using a bat file
@echo off
echo Enter your account address:
set /p account=""
echo Enter your password:
set /p password=""
echo Attaching to Geth and unlocking the account...
geth attach \.pipegeth.ipc --exec "personal.unlockAccount('%account%', '%password%', 0)"
cd "E:\finishmyTruffle"
echo Deploying contracts...
echo Do you agree to perform this action? (Y/N)
choice /c YN /n
if errorlevel 2 (
echo "you voted against"
truffle console --network geth --exec "let voting = await Voting.deployed()"; "voting.voteAgainst({from: '%account%'})"
) else (
echo "you voted for"
truffle console --network geth --exec "let voting = await Voting.deployed()"; "voting.voteFor({from:'%account%''})"
)
cmd /k
these lines don’t work:
truffle console --network geth --exec "let voting = await Voting.deployed()"; "voting.voteAgainst({from: '%account%'})"
I don’t use bat files for a long time and thought that –exec would give access with the work of the js console