Running a BAT file in background with invisible.vbs, but how to stop it?

15,519

Without seeing the contents of the batch my guess is the CMD.exe runs your batch which launches your bitcoin process and then ends. This would explain why you're not seeing CMD.exe.

If you want to see an example when you would see cmd.exe you can create a batch that never ends like so.

:TOP
REM FOO
GoTo TOP

Then run inivisible.vbs with this batch and you'll see the cmd.exe in your task. If you use process explorer you'll be able to see the batchfile's name in the command line for the image. Which would look something like this

`cmd /c ""C:\Whaterver\Looptest.bat" "

UPDATE

As Harry Steinhilber already pointed out the process will be java.exe

If you run process explorer and select the Java.Exe you should see this in the command prompt

java -cp target\libs\*;target\DiabloMiner-0.0.1-SNAPSHOT.jar -Djava.library.path=target\libs\natives\windows com.diablominer.DiabloMiner.DiabloMiner -u <username> -p <password> -o <pool> -p 8332 -w 64 -f 1000

This will allow you to identify the DataMiner from other java applcations (if any) that you are running.

Share:
15,519

Related videos on Youtube

2rs2ts
Author by

2rs2ts

Bio My name is Andrew BS Computer Science (2014), Minors in Software Engineering and Audio Engineering Working in industry since 2013 Tech Currently doing a lot of AWS, terraform, and Kubernetes stuff (@angarrett in K8s and calico slack) "Favorite" language is Python Other langs: bash, Go, Ruby In past lives: Scala, Java, Javascript/Coffeescript, C/C++, Erlang, Prolog, Lisp, SQL/CQL Other stuff: Cassandra, ansible, Puppet, Datadog, tmux Daily driving a Mac but I do most development on Linux Open Source Contributions Kubernetes terraform awscli datadog-agent moto troposphere kubectl-view-utilization powerline pam_hook packer packagecloud's Java client cascade specs2 hubot-meme Not-programming stuff I can hold my own in GIMP, Adobe Premiere, Audacity, and OBS

Updated on June 04, 2022

Comments

  • 2rs2ts
    2rs2ts almost 2 years

    I'm using a solution like the one mentioned here run bat file in background but the bat file in question runs a Bitcoin GPU miner in the background. Sometimes I want to stop the miner, but since I am trying to run it invisibly (because I don't want it in my taskbar) I can't stop the process. I can't even find it in my process manager (no cmd.exe or conhost.exe). [I'm not even sure it's running.] Any help?

    edit: It is most definitely running; opening the process with a window shows that the miner was running at half capacity, which in the past indicated the miner was open twice.

    edit2: here are the contents of the batch files, if it helps.

    batch file I run to start everything:

    wscript.exe "D:\Desktop\invisible.vbs" "C:\Program Files (x86)\Bitcoin\DiabloMiner\bpm.bat"
    

    bpm.bat:

    cd "C:\Program Files (x86)\Bitcoin\DiabloMiner"
    java -cp target\libs\*;target\DiabloMiner-0.0.1-SNAPSHOT.jar -Djava.library.path=target\libs\natives\windows com.diablominer.DiabloMiner.DiabloMiner -u <username> -p <password> -o <pool> -p 8332 -w 64 -f 1000
    

    invisible.vbs:

    set args = WScript.Arguments
    num = args.Count
    
    if num = 0 then
        WScript.Echo "Usage: [CScript | WScript] invis.vbs aScript.bat <some script arguments>"
        WScript.Quit 1
    end if
    
    sargs = ""
    if num > 1 then
        sargs = " "
        for k = 1 to num - 1
            anArg = args.Item(k)
            sargs = sargs & anArg & " "
        next
    end if
    
    Set WshShell = WScript.CreateObject("WScript.Shell")
    
    WshShell.Run """" & WScript.Arguments(0) & """" & sargs, 0, False
    
    • Harry Steinhilber
      Harry Steinhilber about 13 years
      Based on the batch files, I don't think CMD.exe would still be running. I would be looking for a java.exe process to kill instead.
  • 2rs2ts
    2rs2ts about 13 years
    I added the contents of the batch files to the question. I'm not sure your answer helps me though.

Related