Author

Topic: Want to send bitcoins from the command-line in windows (Read 7049 times)

legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
Yeah. If you send me a whole 1.0 BTC, I will put your link in my sig line for an entire year. I post every day or every few days. So you will get at least 365 exposures or more. PM me for an address if you're interested. hehe.
sr. member
Activity: 300
Merit: 250
@bitcoinspot.nl: Someone bought my sig line for 0.1 BTC per month. I think the store sells tshirts, cafepress does a lot of tshirt printing (and other items) for anyone who has a design. I figured it was a good deal considering all I've been doing at other "faucets".

someone bought you sig-line?
wow thats new to me.... always a way to make some money with bitcoins i guess Smiley
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
@bitcoinspot.nl: Someone bought my sig line for 0.1 BTC per month. I think the store sells tshirts, cafepress does a lot of tshirt printing (and other items) for anyone who has a design. I figured it was a good deal considering all I've been doing at other "faucets".
sr. member
Activity: 300
Merit: 250
@dabs: do you want to send me an email on [email protected], i want to ask you something about the bitcoin megastore.

thanks!
sr. member
Activity: 300
Merit: 250
Ok i put the whole batchfile here...
the batchfile gets data from a pop box and uses that to send coins and emails
i just keep it continously running om my windows machine.
see REM for the remarks.
At the end of the batchfile i call bitcoind.exe to send the bitcoins

This is what my bitcoin.conf looks like
Quote
server=1
rpcuser=xxxxxxx
rpcpassword=xxxxxxxxx
i keep my bitcoin-qt client running in the background


The batch file
Quote
@echo off
cls
set timeout=10

:_loop
REM call the external popclient program to get messages fro pop3 mailbox
c:\temp\popclient\popclient.exe -configfile c:\temp\popclient\democonfig.xml
REM process all the .txt files downloaded by popclient and call :_readfile for every file
for /f %%A in ('dir /B *.txt') do call :_readfile %%A
echo pause %timeout% sec ....
ping 100.100.100.100 -w 1000 -n %timeout% > nul
REM Back to the start
goto :_loop

::------------------------------------------------------------------------------------

:_readfile

set email=empty
set address=empty
set naam=empty

REM Get email data from the email file and put it in variables
REM in my setup i forward the mail and put em, ad and na in front of the name
REM address and email-adress and put that in the message
type %1 | find "em:" /I > %temp%\temp.txt
echo em:
type %temp%\temp.txt
echo ---
for /f "tokens=2 delims=:" %%a in (%temp%\temp.txt) do (@set email=%%a)
type %1 | find "ad:" /I > %temp%\temp.txt
echo ad:
type %temp%\temp.txt
echo ---
for /f "tokens=2 delims=:" %%a in (%temp%\temp.txt) do (@set address=%%a)
type %1 | find "na:" /I > %temp%\temp.txt
echo na:
type %temp%\temp.txt
echo ---
for /f "tokens=2 delims=:" %%a in (%temp%\temp.txt) do (@set username=%%a)

del %temp%\temp.txt

echo -----------------------------------------------------
echo %date% - %time%
echo file: %1
echo email: %email%
echo address: %address%
echo naam: %username%

pause


REM Put all the data in a logfile
echo ----------------------------------------------------- >> c:\temp\popclient\inbox\log.dat
echo %date% - %time%                                       >> c:\temp\popclient\inbox\log.dat
echo file: %1                                              >> c:\temp\popclient\inbox\log.dat
echo email: %email%                                        >> c:\temp\popclient\inbox\log.dat
echo address: %address%                                    >> c:\temp\popclient\inbox\log.dat
echo naam: %username%                                      >> c:\temp\popclient\inbox\log.dat
move %1 c:\temp\popclient\inbox\processed\

REM Call the bitcoin daemon and send the money to the adress retrieved fro the mail
"c:\Program Files (x86)\bitcoin\daemon\bitcoind.exe" -rpcpassword=xxxxxxxxxx sendtoaddress %address% 0.001 "0.001 naar %email%" "0.001 naar %email%" >> c:\temp\popclient\inbox\log.dat

echo beste %username% > %temp%\bericht.txt
type c:\temp\popclient\template.txt >> %temp%\bericht.txt

set subject="0.001 bitcoins - met de groeten van bitcoinspot.nl"

REM Send mail to email-adress retrieved from mail
c:\temp\popclient\blat %temp%\bericht.txt -to %email% -f [email protected] -subject %subject% -server x.x.nl > %temp%\temp.txt

type %temp%\temp.txt >> c:\temp\popclient\inbox\log.dat

del %temp%\bericht.txt

REM End of procedure, return to loop
goto :EOF

::------------------------------------------------------------------------------------
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
For the newbies out there, can you show us how? I was trying to get the command line to work, but I'm thinking I'm starting this wrong or my bitcoin.conf is missing something.

What I've been able to do is bitcoin-qt and typing in the debug console.
sr. member
Activity: 300
Merit: 250
yeah i just made a batchfile that sends commands to bitcoind, works like a charm Smiley

if you need any help let me know.
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
I'm interested. I want to make something that is semi-automated to do something similar but for a different service. I need to be able to get the balance, so there is getbalance, or listtransactions so I know if I got something back, or while I am waiting for coins sent to me to confirm. And of course, sending coins to an address.

I plan on using one of those Windows command line Basic compilers, since I have some experience with them, calling the bitcoin server (bitcoin-qt or bitcoind).

And of course, it has a lot of if-then-else statements to make sure I don't lose all my coins, or it sends too often or too fast.
sr. member
Activity: 300
Merit: 250
haha, i bet you are
legendary
Activity: 1512
Merit: 1036
ok thanks so much for the getting-started, once i got going it was quite easy!

I am now running a windows client that:
- gets mail out of a pop box
- gets the senders email and btc address
- send 0.001 btc to the sender
- sends the sender an email.

If anyone's interested how i did it, just let me know!

Thanks again!
Roland.

I'm more interested in sending some emails to this email address!
sr. member
Activity: 300
Merit: 250
ok thanks so much for the getting-started, once i got going it was quite easy!

I am now running a windows client that:
- gets mail out of a pop box
- gets the senders email and btc address
- send 0.001 btc to the sender
- sends the sender an email.

If anyone's interested how i did it, just let me know!

Thanks again!
Roland.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
You need to have setup up at least rpcpassword in bitcoin.conf first then to start the daemon use "start bitcoind" and to test a command:

Code:
bitcoind -rpcpassword=password listtransactions

If you are wanting to use the RPC commands with bitcoind whilst bitcoin-qt is also running then add "server=1" into bitcoin.conf (then start bitcoin-qt first rather than bitcoind as a daemon).

I would also recommend adding "rpcallowip=127.0.0.1" so that external IP addresses cannot send RPC commands.
sr. member
Activity: 300
Merit: 250
ok but how do i send commands, sorry stupid question maybe, but i cant seem to do it trough the command line.

thanks in advance!
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
The standard Satoshi client for Windows comes with bitcoind which acts as server and as an RPC client.

https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list
sr. member
Activity: 300
Merit: 250
Hi everyone,

i am currently working on a bitcoin-faucet-like script that sends bitcoins to selected people.
I want to let the script send bitcoins from a batch-file at specified intervals.

I have searched for a client that can send bitcoins from the command-linne in windows, but sofar i havent succeeded.
Does anyone know a good windows-based bitcoin-client that can send bitcoins from the command-line ?

Thanks!
Roland.
Jump to: