There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot browser bsod computer crash css dell desktop driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware help please hijackthis hjt hjt log install internet internet explorer itunes javascript keyboard laptop log malware monitor network networking openoffice outlook outlook 2003 outlook express password popups problem router seo slow sound sp3 spyware startup trojan usb video virtumonde virus vista vundo windows windows xp winxp wireless youtube
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
My batch file is killing my processor usage


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
Chris Stroud's Avatar
Junior Member with 6 posts.
 
Join Date: May 2008
17-May-2008, 11:05 AM #1
My batch file is killing my processor usage
Hey, this is my first time on this forum and I hope someone can help me out here. I am trying to make a batch file that runs silently in the background and repeatedly kills a process so that an application can't ever really open. My setup isn't the greatest because I have put together several sample code items to do this, and if you are wondering I will be compiling them into exe's and compiling them as ghost applications. When I run my current setup, it does the job but my processor monitor stays at 100% and I have an hour glass beside my cursor until I reboot. The system runs fine but it seems to just think that it is overloaded. Anyway, here is the code for my 3 files:

The VB script:

Code:
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
The "trigger script"

Code:
@echo off
start /low /b wscript.exe "invisible.vbs" "overkill.exe"
EXIT
The "Overkill" script (I make random filenames)

Code:
@echo off
TSKILL halo /A
trigger.exe
EXIT
I would really appreciate any help you guys can give me.

Thanks! -Chris
Chris Stroud's Avatar
Junior Member with 6 posts.
 
Join Date: May 2008
17-May-2008, 11:07 AM #2
Sorry for the double post, but by the way this is made to be a game blocker (aka Halo)
devil_himself's Avatar
Distinguished Member with 4,794 posts.
 
Join Date: Apr 2007
Location: India
Experience: Advanced
18-May-2008, 06:30 AM #3
check this

Code:
@echo off
setlocal
 
:: Define operating environment
set app=notepad.exe
set Wait=60
 
start "" "%app%"
 
 
::Verify Instance Running
tasklist |find /i "%app%" >nul
if not errorlevel 1 echo %app% is running
 
echo Monitoring: %app%
echo waiting:    %Wait% seconds
 
:wait
ping -n %Wait% localhost >nul
tasklist |find /i "%app%" >nul
if not errorlevel 1 echo process still running & goto :close
 
:close
taskkill /f /im "%app%" >nul
Chris Stroud's Avatar
Junior Member with 6 posts.
 
Join Date: May 2008
19-May-2008, 09:11 PM #4
Thanks, I'll give that a try soon. You are a lifesaver if that works, but it makes sense.
Chris Stroud's Avatar
Junior Member with 6 posts.
 
Join Date: May 2008
19-May-2008, 11:21 PM #5
Well, I just get an error that the application cannot be found (not running I guess). This simply should watch for the app to open and immediately close it...
devil_himself's Avatar
Distinguished Member with 4,794 posts.
 
Join Date: Apr 2007
Location: India
Experience: Advanced
19-May-2008, 11:52 PM #6
you want that the batch never closes and keep looking for the running application

What you want to achieve should be done with some other third party tools
like autohotkey --> http://www.autohotkey.com/
Chris Stroud's Avatar
Junior Member with 6 posts.
 
Join Date: May 2008
20-May-2008, 01:20 AM #7
Thanks, that is exactly what I needed once I figured it out. I now just need to find how I can disable the right click function of the tray icon... it is pointless if it can be right clicked and exited. Thanks, you have helped tons so far!
Squashman's Avatar
Distinguished Member with 12,328 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
20-May-2008, 10:31 AM #8
This is what I would have used.
http://www.beyondlogic.org/solutions...ust-no-exe.htm

There are other batch file utilities you could have used to hide the cmd window instead of using the VBscript.
Chris Stroud's Avatar
Junior Member with 6 posts.
 
Join Date: May 2008
20-May-2008, 04:21 PM #9
well that is a nice application but that would be a ******* if I might be so bold to say to administer to the machines on our network. The autokey app mentioned above does wonderfully, I just need to disable the ability to right click the tray icon ( If I turn it off, my balloon messages can't appear) thanks for any help you can give me to finish this task, I really appreciate it!
Squashman's Avatar
Distinguished Member with 12,328 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
20-May-2008, 07:44 PM #10
Quote:
Originally Posted by Chris Stroud View Post
well that is a nice application but that would be a ******* if I might be so bold to say to administer to the machines on our network.
How So! We actually tested this out on a network of 600 machines when I worked for the school district but we ended up going with a different package that Integrated into our ZenWorks software.

Quote:
Installing software and modify settings on multiple computers is never fun, yet alone efficient. With Trust-no-exe you need only install the package on a single workstation. Once installed and appropriately configured, you may utilise the Multiple Workstation functionality to remotely install it with your configuration on other selected computers.
devil_himself's Avatar
Distinguished Member with 4,794 posts.
 
Join Date: Apr 2007
Location: India
Experience: Advanced
20-May-2008, 08:25 PM #11
You Can Get Help For AutoHotkeyHere --> http://www.autohotkey.com/forum/
Keebellah's Avatar
Computer Specs
Member with 84 posts.
 
Join Date: Mar 2008
Location: Netherlands
Experience: Advanced
23-May-2008, 01:13 AM #12
Hi, I am always browsing Business Applications but just by accident saw this post.
Thanks "devil" for the tip I like the batch file and it simplifies my version.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 04:05 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.