• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

I need some help creating a *.bat file.

Blur

Senior member
Hey guys, can someone help me with a simple (i think) batch file. I need a batch file that will run an *.exe file and then kill the process, then run it and kill it again and then run it. Can someone help me write this file?

Thanks.
 
You're not the thought police Loke, besides, if he can't write a batch file he's not going to get far as an evil hacker is he?

Blur: Windows doesn't come with a command line process lister/killer. You'll have to download pskill and use that from the batch file after waiting for the process to complete, like:

start X.exe
sleep Y
pskill Z

...

repeat

 
I?m not going to use it to do anything wrong.

There's and application called GAAP Xtra------->http://www.cch.co.uk/cch/cart/details01.asp?id=240 that I?ve installed on my PC but it doesn't work correctly. I've found that if I kill and restart the process as I detailed above it works, I think the problem is with the java runtime engine but nothing I?ve done seems to resolve the problem so that's why I wanted to get this batch file so I can avoid having to do this manually whenever I want to run the app.
 
Originally posted by: Atheus
You're not the thought police Loke, besides, if he can't write a batch file he's not going to get far as an evil hacker is he?

No, I'm not. But rather than offer my services to someone with mal-intent, I'd rather know ahead of time so I can act accordingly. If someone asked you to build them a nuke, would you do it?
 
Thanks for the great start Atheus, :thumbsup: i guess i'll have to play around with the batch file, i'd really like the stopping and starting of the process to happen as quickly as possible.

Originally posted by: Atheus
You're not the thought police Loke, besides, if he can't write a batch file he's not going to get far as an evil hacker is he?

Blur: Windows doesn't come with a command line process lister/killer. You'll have to download pskill and use that from the batch file after waiting for the process to complete, like:

start X.exe
sleep Y
pskill Z

...

repeat

 
Originally posted by: Blur
Is Sun Java a different product?

Nah, notice at the top of the page you linked to - "Java.com, brought to you by Sun Microsystems". I just meant have you upgraded from the crappy Microsoft Java 1.1 runtime to a newer Sun version.

Originally posted by: LoKe
If someone asked you to build them a nuke, would you do it?

Sure! If they were gonna use it one someone I don't like 🙂

Seriously though, a batch file is hardly a nuke, if someone asked how to write metamorphic code or run an invisible process I might be worried.

 
This is what happens when i run the batch file, i'm going to have to tweak it a bit I guess.

C:\Documents and Settings\trd\Desktop>START /M "C:\WINDOWS\NOTEPAD.EXE"
Invalid switch - "/M".

C:\Documents and Settings\trd\Desktop>TASKKILL /IM notepad.exe
ERROR: The process "notepad.exe" not found.

C:\Documents and Settings\trd\Desktop>SLEEP 1
'SLEEP' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\trd\Desktop>START /M "C:\WINDOWS\NOTEPAD.EXE"
Invalid switch - "/M".

C:\Documents and Settings\trd\Desktop>TASKKILL /IM notepad.exe
ERROR: The process "notepad.exe" not found.

C:\Documents and Settings\trd\Desktop>SLEEP 1
'SLEEP' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\trd\Desktop>START /M "C:\WINDOWS\NOTEPAD.EXE"
Invalid switch - "/M".

C:\Documents and Settings\trd\Desktop>TASKKILL /IM notepad.exe
ERROR: The process "notepad.exe" not found.
 
In XP to start a program minimized it's "start /MIN C:\Windows\Notepad.exe"

Sleep.exe or Wait.exe need to be downloaded, they're not regular programs in windows.
 
Originally posted by: CalvinHobbes
In XP to start a program minimized it's "start /MIN C:\Windows\Notepad.exe"

Sleep.exe or Wait.exe need to be downloaded, they're not regular programs in windows.

That must be it, thanks, i'll look for those .exes

 
Back
Top