在后台运行一个带有invisible.vbs的BAT文件,但是如何停止它呢?
我正在使用类似于此处提到的解决方案在后台运行bat文件,但是相关的 bat 文件在后台运行比特币 GPU 挖矿程序。有时我想停止矿工,但由于我试图以不可见的方式运行它(因为我不希望它出现在我的任务栏中),所以我无法停止该过程。我什至在进程管理器中找不到它(没有 cmd.exe 或 conhost.exe)。 [我什至不确定它是否正在运行。] 有帮助吗?
编辑:它肯定正在运行;用窗口打开进程显示矿工以一半的容量运行,这在过去表明矿工打开了两次。
edit2:这里是批处理文件的内容,如果有帮助的话。< /em>
我运行的批处理文件来启动一切:
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果没有看到批处理的内容,我的猜测是 CMD.exe 运行您的批处理,该批处理启动您的比特币进程,然后结束。这可以解释为什么您看不到 CMD.exe。
如果您想查看 cmd.exe 的示例,您可以创建一个像这样永不结束的批处理。
然后使用该批处理运行 inivisible.vbs,您将在任务中看到 cmd.exe。如果您使用进程资源管理器,您将能够在图像的命令行中看到批处理文件的名称。看起来像这样
`cmd /c ""C:\Whaterver\Looptest.bat" "
更新
正如 Harry Steinhilber 已经指出的那样,进程将是 java.exe
如果您运行进程资源管理器并选择Java.Exe 你应该在命令提示符中看到这个
java -cp target\libs\*;target\DiabloMiner-0.0.1-SNAPSHOT.jar -Djava.library.path=target\libs\natives\windows com .diablominer.DiabloMiner.DiabloMiner -u <用户名>; -p <密码> -o <池> -p 8332 -w 64 -f 1000
这将允许您从正在运行的其他 java 应用程序(如果有)中识别 DataMiner。
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.
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.
您可以使用 VBScript。
抱歉排了很长的队。将此处的文本更改为 jar 文件的位置,它将终止它。
You can use VBScript.
Sorry about the long line. Change the text where it says HERE to the location of your jar file and it will terminate it.