473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Easy way for user to kill an executable file?

i have created an automation program using Perl (Win32). i converted the perl script to an executable file. what i would like to do is have a way for the user to easily kill the executable file if necessary. for instance, have a button somewhere on the desktop that they can just click it and the executable will stop. Or inset some lines of code that would specify a 'button' sequence that the user can press on the keyboard that would trigger the executable to stop. Is this possible? i have no code to post because I have no idea where to start!

At this point, in order to stop the executable, i have to press CTRL-ALT-DEL, go to task manager and stop the process.

Help please!
Terra
Sep 18 '08 #1
4 2313
Icecrack
174 Expert 100+
it really depends on how you are running this perl code, you can try CTRL + C ?????

Note: i do know this was 6 days old
Sep 24 '08 #2
thanks for your input. however, CTRL-C only works if i run it as a Perl script (*.pl). if i convert it to an executable (*.exe), CTRL-C doesn't work.
Oct 1 '08 #3
Icecrack
174 Expert 100+
thanks for your input. however, CTRL-C only works if i run it as a Perl script (*.pl). if i convert it to an executable (*.exe), CTRL-C doesn't work.

you can look at this module

http://search.cpan.org/dist/TermReadKey/ReadKey.pm

if you can reprogram your code, then i will add the above and look for a shortcut(hotkey) to quit the program.

try something like this:

Expand|Select|Wrap|Line Numbers
  1. ReadMode 4, IN;
  2. $k = "";
  3. $in = \*IN; # or *IN or "IN" 
  4. while($k ne \cq)  # Looks for Control + q
  5. {
  6.  while !defined($k=ReadKey(-1, $in));
  7.  
  8. #Run Code Here
  9.  
  10. }
  11.  
  12. ReadMode 0, IN;
  13.  
Oct 1 '08 #4
Thanks! I'll take a look at this!
Terra
Oct 2 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: PatchFactory Support | last post by:
Description: Professional and easy-to-use patch building environment that can help you to create instant patch packages for software and file updating. Generated patch packages are small size...
8
by: Xero Limit 126 | last post by:
Okay, I am completely new to Python, and I really dont understand much, but I was wondering how to make a python script/program into a standalone .EXE? I dont understand py2exe at all, so if...
0
by: Markus Poehler | last post by:
Hi my program should run on terminal server. I open Acrobat process and I have to kill them at some points in my application. This fails cause of insufficient rights on terminal server. the...
1
by: Alexander N. Spitzer | last post by:
I am trying to write a program that will fork a process, and execute the given task... the catch is that if it runs too long, I want to clean it up. this seemed pretty straight forward with a...
10
by: Sorin Dolha [MCSD .NET] | last post by:
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another...
16
by: bie2 | last post by:
Hi, Here's what I want to do: 1. Start the application. 2. A SplashScreen running in its own thread is started. 3. I'm checking if the application needs an update. 4. If an update is needed...
0
by: WATYF | last post by:
This is my problem... I have some code that starts a Process and returns it to a variable... (prcBat) At any time while that process is running... I want to be able to Kill it by pressing a...
1
by: Daniel | last post by:
how to forcfully kill a running process by executable name with a .net application?
10
by: I. Myself | last post by:
Suppose we spawn a child process with Popen. I'm thinking of an executable file, like a compiled C program. Suppose it is supposed to run for one minute, but it just keeps going and going. Does...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.