Bitcoin Forum
April 16, 2024, 11:36:41 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Hiding the command window  (Read 8311 times)
theGECK (OP)
Sr. Member
****
Offline Offline

Activity: 411
Merit: 250



View Profile
March 23, 2011, 06:23:57 PM
 #1

Here's a question - I would like to hide the command window for the miners on my machine. The miners don't affect my machine's performance, throttle down when I want to watch/play something, and then come right back up when I'm done with it. Since I haven't closed any of them down for quite some time, I'd like for the command prompt to be hidden when I launch it, or at least off of my taskbar (Windows). Is there a way to do this?

Use my referral codes for Bitcoin faucets and I'll send you 30% of my referral bonus - Win/Win! PM for details on all sites available or use one of the links here.

FreeBitco.in | FreeDoge.co.in
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
MikeDaSpike
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 23, 2011, 07:09:37 PM
 #2

Google movetotray or minimize to tray. There are several apps that can minimize any window to the system tray.
hangover
Newbie
*
Offline Offline

Activity: 14
Merit: 0



View Profile WWW
March 24, 2011, 05:43:19 AM
 #3

Or you can write simple AutoIt script (miner-starter) to start miner from it and compile it to exe with corresponding option.
Herodes
Hero Member
*****
Offline Offline

Activity: 868
Merit: 1000


View Profile
March 28, 2011, 05:43:31 PM
 #4

Here's a vb-script that I made. It will hide the cmd window from showing. Change it to your needs and put it in a .vbs-file in the startup folder:

Code:
'Script to start bitcoin and poclbm.exe in the background.
'Will track time run in seconds in c:\bitcoin\logs\run.log

'run bitcoin server
Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.Run "cmd /C START /b C:\bitcoin\bitcoin-0.3.20.01\daemon\bitcoind.exe", SHOW_ACTIVE_APP, FALSE

' Delay 10 seconds
WScript.Sleep 10000


Dim starttime
starttime = Now()

Set objShell2 = Wscript.CreateObject("Wscript.Shell")

objShell.CurrentDirectory = "C:\bitcoin\poclbm_py2exe_20110222" 
objShell2.Run "C:\bitcoin\poclbm_py2exe_20110222\poclbm.exe --user=username --pass=password --device=0 --verbose --rate=60 >> c:/bitcoin/logs/rate.log", SHOW_ACTIVE_APP, False


Dim endtime
endtime = Now()


Dim timedif

timediff = starttime - endtime


Dim logdata, myFSO, logfile, dateStamp
dateStamp = Date()

'Write information to Text File
Dim secs

logdata = DateDiff("s",starttime,endtime)

Set myFSO = CreateObject("Scripting.FileSystemObject")
Set logfile = myFSO.OpenTextFile("C:\bitcoin\logs\runtime.log", 8, True)
logfile.WriteLine(logdata)
logfile.Close
SET logfile = NOTHING
SET myFSO = NOTHING
LMGTFY
Hero Member
*****
Offline Offline

Activity: 644
Merit: 502



View Profile
March 28, 2011, 05:49:25 PM
 #5

What about running bitcoind (bitcoind.exe?) as a Windows service? You'd be able to start/stop/restart it through the "Services" management console GUI, and there would (I presume) be no unpleasant terminal window.

Disclaimer: reason I mention this is because someone asked how to do this fairly recently, here on the forum, and my "contribution" was less than stellar, as I recall (it's been some time since I last regularly used Windows...)

This space intentionally left blank.
[Tycho]
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
March 28, 2011, 05:54:55 PM
 #6

Also those windows will not be shown if you run miners as different user in Windows, using scheduler.

Welcome to my bitcoin mining pool: https://deepbit.net - Both payment schemes (including PPS), instant payout, no invalid blocks !
ICBIT Trading platform : USD/BTC futures trading, Bitcoin difficulty futures (NEW!). Third year in bitcoin business.
bobR
Member
**
Offline Offline

Activity: 112
Merit: 10


View Profile
March 28, 2011, 05:58:16 PM
 #7

Create a shortcut to start it... start minimized ... add it to your start up file

or schedule it as a task to run at start up ad never see it
or schedule it only to run when idle
urizane
Newbie
*
Offline Offline

Activity: 56
Merit: 0



View Profile
March 28, 2011, 09:47:35 PM
 #8

The point of the original post was to get the terminal windows off of his taskbar.  For me, I don't mind the terminal windows since minimizing things puts them at the end of the Alt+Tab list.  I generally don't mess with the taskbar unless I want to mess with the clock.
theGECK (OP)
Sr. Member
****
Offline Offline

Activity: 411
Merit: 250



View Profile
March 28, 2011, 09:55:34 PM
 #9

Also those windows will not be shown if you run miners as different user in Windows, using scheduler.

So, if I had multiple user accounts on a machine, I could use the scheduler to run something and it won't show up? So, I could run a .bat file to join a pool, and it wouldn't show the command prompt? I will test this out.

Use my referral codes for Bitcoin faucets and I'll send you 30% of my referral bonus - Win/Win! PM for details on all sites available or use one of the links here.

FreeBitco.in | FreeDoge.co.in
Ricochet
Sr. Member
****
Offline Offline

Activity: 373
Merit: 250



View Profile
March 30, 2011, 05:17:16 AM
 #10

I've always been a fan of the "PowerMenu" app for minimizing programs to the tray.  It's a *really* small and simple file (less than 150 KB) and it does what it's supposed to do.  I use the version that doesn't require installation, though I'm guessing the installer version would have an option to start at bootup if you'd like.

http://www.abstractpath.com/powermenu/
TurdHurdur
Full Member
***
Offline Offline

Activity: 216
Merit: 100


View Profile
March 30, 2011, 05:40:53 AM
 #11

I like hidec.exe/RunHiddenConsole.exe which you can get from http://redmine.lighttpd.net/attachments/660/RunHiddenConsole.zip, where I originally found the link here: http://wiki.nginx.org/PHPFastCGIOnWindows. It's only 2KB and I use it for a scheduled task that rysncs a file on a remote server. Security software may complain about it, seeing it can be used for malicious purposes.

If you still want output, you could make a shortcut like:

Target: C:\path\to\hidec.exe cmd /C "miner.exe --arguments values > output.txt"
Start in: C:\path\to\miner

You'll have to kill them from Task Manager, which isn't a big deal with miners.
theGECK (OP)
Sr. Member
****
Offline Offline

Activity: 411
Merit: 250



View Profile
March 30, 2011, 04:56:40 PM
 #12

So, I've discovered a VBS script can make a hidden window. Here's where I am:

This is a VBS script that can launch something. In this case, Ufasoft's CPU miner.
Code:
Set objApp = CreateObject("WScript.Shell")
objApp.Run "cmd /C C:\CPUMiner\bitcoin-miner.exe -o http://mining.bitcoin.cz:8332 -u theGECK.noway -p idontthinkso -g no"

M$ has a sample script up here that lets you launch notepad in a hidden window. You can kill notepad from the task manager, but not go to it using alt+tab. Right now, I'm assuming that you are essentially just running the notepad.exe but because the window is set to hidden, are unable to use it.
Code:
Const HIDDEN_WINDOW = 12
 
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objStartup = objWMIService.Get("Win32_ProcessStartup")
 
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = HIDDEN_WINDOW
Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
errReturn = objProcess.Create("Notepad.exe", null, objConfig, intProcessID)

So, I'm now trying to figure out how exactly to make this launch the CPU miner in the hidden window. I would continue to work on this right now, but I need to get some work done that isn't bitcoin related, so I figured I'd put my discoveries here for y'all. My assumption is that just changing notepad.exe won't work, since the GetObject above it is specifying root, but I could be very wrong, and maybe all that is needed is to paste the Ufasoft string into where it says notepad.exe.

Use my referral codes for Bitcoin faucets and I'll send you 30% of my referral bonus - Win/Win! PM for details on all sites available or use one of the links here.

FreeBitco.in | FreeDoge.co.in
Miner-TE
Hero Member
*****
Offline Offline

Activity: 499
Merit: 500



View Profile
March 30, 2011, 05:45:50 PM
 #13

This works for me.  Save file as .VBS and modify the command line

C:\Mine\ufasoft\bitcoin-miner.exe -t 2 -o http://mining.bitcoin.cz:8332 -u <USERNAME> -p <Password>


Code:
Const HIDDEN_WINDOW = 12
 
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objStartup = objWMIService.Get("Win32_ProcessStartup")
 
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = HIDDEN_WINDOW
Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
errReturn = objProcess.Create("C:\Mine\ufasoft\bitcoin-miner.exe -t 2 -o http://mining.bitcoin.cz:8332 -u <USERNAME> -p <Password>", null, objConfig, intProcessID)


BTC - 1PeMMYGn7xbZjUYeaWe9ct1VV6szLS1vkD - LTC - LbtcJRJJQQBjZuHr6Wm7vtB9RnnWtRNYpq
BitterTea
Sr. Member
****
Offline Offline

Activity: 294
Merit: 250



View Profile
March 30, 2011, 06:05:54 PM
 #14

You could use Kiv's poclbm GUI. I think it's really slick, and hides in the task bar when not in use.
theGECK (OP)
Sr. Member
****
Offline Offline

Activity: 411
Merit: 250



View Profile
March 30, 2011, 07:20:01 PM
 #15

You could use Kiv's poclbm GUI. I think it's really slick, and hides in the task bar when not in use.

I do, which is what made me want something similar (or better) for the Ufasoft's CPU miner that I run.

Or for when I visit a friend's house and want to "use his computer to check my email". Smiley

Use my referral codes for Bitcoin faucets and I'll send you 30% of my referral bonus - Win/Win! PM for details on all sites available or use one of the links here.

FreeBitco.in | FreeDoge.co.in
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!