Author

Topic: Hiding the command window (Read 8340 times)

sr. member
Activity: 411
Merit: 250
March 30, 2011, 02: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
sr. member
Activity: 294
Merit: 252
March 30, 2011, 01: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.
hero member
Activity: 499
Merit: 500
March 30, 2011, 12: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 -p


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 -p ", null, objConfig, intProcessID)

sr. member
Activity: 411
Merit: 250
March 30, 2011, 11:56:40 AM
#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.
full member
Activity: 216
Merit: 100
March 30, 2011, 12: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.
sr. member
Activity: 373
Merit: 250
March 30, 2011, 12: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/
sr. member
Activity: 411
Merit: 250
March 28, 2011, 04: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.
newbie
Activity: 56
Merit: 0
March 28, 2011, 04: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.
member
Activity: 112
Merit: 10
March 28, 2011, 12: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
hero member
Activity: 742
Merit: 500
March 28, 2011, 12:54:55 PM
#6
Also those windows will not be shown if you run miners as different user in Windows, using scheduler.
hero member
Activity: 644
Merit: 503
March 28, 2011, 12: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...)
hero member
Activity: 868
Merit: 1000
March 28, 2011, 12: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
newbie
Activity: 14
Merit: 0
March 24, 2011, 12: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.
newbie
Activity: 3
Merit: 0
March 23, 2011, 02:09:37 PM
#2
Google movetotray or minimize to tray. There are several apps that can minimize any window to the system tray.
sr. member
Activity: 411
Merit: 250
March 23, 2011, 01: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?
Jump to: