Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Run BATCH file quietly (hide dos window)


  • Please log in to reply

#1
Sebz4n

Sebz4n

    Member

  • Member
  • PipPip
  • 35 posts
Hello!

I am trying to have a batch file run every 10 minutes, which kills two processes and then restarts them.
Now, I want this to run hidden (which I have basically covered), so I don't get thrown out to the desktop, if I play games while the batch file executes.

My problem: The taskkiller has some kind of "feedback" or "report", which briefly opens a cmd window saying something like "Succuss bla bla killed guiminer" or "Failed bla bla guiminer is not running". This window appears and disappears instantly, so it drags me out to the desktop but I can never see what it actually says precisely.

This is my .vbs script, which runs the batch hidden:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "G:\Users\Sebz4n_GAME_OS2\Desktop\Restart GUIMiner.bat" & Chr(34), 0
Set WshShell = Nothing


This is my batch file, which is running quietly (hidden):

start TASKKILL /F /IM "guiminer.exe"
start TASKKILL /F /IM "poclbm.exe"
PING 1.1.1.1 -n 1 -w 1000 > NUL
start /d "G:\Users\Sebz4n_GAME_OS2\Desktop\GUIMiner\" miner.lnk


So, how do I stop it from giving said "report" ??
Is there an easier way of doing this (Running batch hidden/Restarting a program every 10 minutes)
  • 0

Advertisements


#2
Sebz4n

Sebz4n

    Member

  • Topic Starter
  • Member
  • PipPip
  • 35 posts
The report is from the taskkiller, and it says something about the PID's of the .exe files not being found or so, even though it does work.
Can I disable this error message? I tried redirecting the commands to a text file by setting it up this way, but it didn't work:


start TASKKILL /F /IM "guiminer.exe" > testlog1.txt
start TASKKILL /F /IM "poclbm.exe" > testlog1.txt
PING 1.1.1.1 -n 1 -w 1000 > NUL

start /d "G:\Users\Sebz4n_GAME_OS2\Desktop\GUIMiner\" miner.lnk


Edited by Sebz4n, 17 June 2011 - 06:35 AM.

  • 0

#3
underscor3

underscor3

    Member

  • Member
  • PipPip
  • 69 posts
Ohh, batch programming, my favorite!!! :)

Have you tried running the batch w/ administrative rights?

Also, as a sanity check, try putting a pause command after the taskkill calls, so we can see the output. So,
start TASKKILL /F /IM "guiminer.exe"
pause
start TASKKILL /F /IM "poclbm.exe"
pause
PING 1.1.1.1 -n 1 -w 1000 > NUL
start /d "G:\Users\Sebz4n_GAME_OS2\Desktop\GUIMiner\" miner.lnk

EDIT: I'm silly. Try the above, but let's also look at the following:

Using START will open the command in a separate window...


So let's get rid of the start calls! Try this:
TASKKILL /F /IM "guiminer.exe" > nul
TASKKILL /F /IM "poclbm.exe" > nul
PING 1.1.1.1 -n 1 -w 1000 > NUL 
start /d "G:\Users\Sebz4n_GAME_OS2\Desktop\GUIMiner\" miner.lnk

Edited by underscor3, 19 June 2011 - 11:19 PM.

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP