Bitcoin Forum
June 24, 2017, 02:08:24 AM *
News: Latest stable version of Bitcoin Core: 0.14.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Batch file help  (Read 759 times)
DrFred
Newbie
*
Offline Offline

Activity: 13


View Profile
May 17, 2012, 04:09:57 PM
 #1

Hi, I've been using a few batch files to manage my mining and I decided to combine them all into one. I produced this

@echo off
title CGMiner
cd cgminer
CHOICE /M "Full power? y/n"
IF ERRORLEVEL 2 SET POWER=low
IF ERRORLEVER 1 SET POWER=high
:START
cd ../lite
CHOICE /M "Litecoin mining? y/n"
IF ERRORLEVEL 2 GOTO NEXT
IF ERRORLEVEL 1 start /AFFINITY 0x0E minerd -t 3 -O DrFred.1:x -o http://miningpool.com:9350
:NEXT
cd ../cgminer
start /AFFINITY 0x01 cgminer.exe -c %POWER%.conf
PAUSE
start /AFFINITY 0x01 cgminer.exe -c reset.conf

However, this doesn't work %POWER% is set to high regardless of what I press, I think it has something to do with the SET command returning it's own errorlevel. Could anyone point out what I'm doing wrong?


I managed to get it almost working how I wanted by changing the code to the following but now the "GOTO HIGH" bit doesn't work (returns 1 was unexpected). (Edit: fixed a typo, now working, but I'd still like it using the set command if possible)

@echo off
title CGMiner
cd cgminer
CHOICE /M "Full power? y/n"
IF ERRORLEVEL 2 GOTO LOW
IF ERRORLEVEL 1 GOTO HIGH
:START
cd ../lite
CHOICE /M "Litecoin mining? y/n"
IF ERRORLEVEL 2 GOTO NEXT
IF ERRORLEVEL 1 start /AFFINITY 0x0E minerd -t 3 -O DrFred.1:x -o http://miningpool.com:9350
:NEXT
cd ../cgminer
start /AFFINITY 0x01 cgminer.exe -c %POWER%.conf
PAUSE
start /AFFINITY 0x01 cgminer.exe -c reset.conf
GOTO END
:LOW
SET POWER=low
GOTO START
:HIGH
SET POWER=high
GOTO START
:END

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!