Bitcoin Forum
May 13, 2024, 06:09:38 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Batch file help  (Read 876 times)
DrFred (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile
May 17, 2012, 04:09:57 PM
Last edit: May 17, 2012, 04:20:40 PM by DrFred
 #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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!