473,587 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Easy way for user to kill an executable file?

57 New Member
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 2334
Icecrack
174 Recognized Expert New Member
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
Perl Beginner
57 New Member
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 Recognized Expert New Member
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
Perl Beginner
57 New Member
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
1732
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 self-extracting executable update programs in a famous installer style with adjustable user-friendly interface and multilingual support. Enhanced with features like easy-to-use interface including a Wizard mode, powerful patch engine, integrated...
8
1778
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 someone could tell me or find me an easy (For a newbie) to convert Python scripts to EXEs, please let me know! Thanks for any help!
0
3322
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 lines: Dim p As New Process For Each p In Process.GetProcesses If LCase(p.ProcessName) = "acrord32" Then 'p.Kill()
1
3455
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 single executable being run from the fork. The problem I am having now is that if I call a shell scripts, then lets say calls "xterm &", after the timeout has occurred, I kill the shell script, but the xterm is still running... I cannot seem to kill...
10
14408
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 user to gain the required rights for execution (the external process needs to create a mailbox in Exchange, so it needs to be run as an Exchange Full Administrator-powered user). For the moment, I have tries using the Start() static method of the...
16
15203
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 I close the SplashScreen and copy the file. 5. Restart the application.
0
2170
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 command button in the application. So the code goes something like this: psiBat = New ProcessStartInfo(arrRun.Item(0)(1)) psiBat.WindowStyle = ProcessWindowStyle.Hidden
1
1557
by: Daniel | last post by:
how to forcfully kill a running process by executable name with a .net application?
10
2985
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 Python have any way to kill it? This is not hypothetical; I'm doing it now, and it's working pretty well, but I would like to be able to handle this run-on condition. I'm using Windows 2000, but I want my program to be portable to linux. ...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5719
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.