473,320 Members | 1,825 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,320 software developers and data experts.

Run external program

is there a way to run somthing like C:/WINDOWS/system32/defrag.exe using c++ and i dont mean like
system("C:/WINDOWS/system32/defrag.exe");
where it accually runs in dos like mode

does anyone know a code like that?
May 10 '07 #1
2 4248
weaknessforcats
9,208 Expert Mod 8TB
Create a thread and make your call on that thread. Check out Win32 CreateThread. Maybe your thread is like:

Expand|Select|Wrap|Line Numbers
  1. DWORD WINAPI MyThread( LPVOID arg)
  2. {
  3.      system("C:\\WINDOWS\\system32\\defrag.exe");
  4.  
  5. }
  6.  
You can go off and do other things while this runs inthe background.
May 10 '07 #2
Banfa
9,065 Expert Mod 8TB
Or look up CreateProcess, you can Google it to find the MSDN help.

This creates a new process (err obviously).
May 12 '07 #3

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

Similar topics

47
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
8
by: Greg Fierro | last post by:
I would appreciate any help from anyone with the following: I have an external program (window32 based) that I am executing with the VBA SHELL command. This program produces a text file which I...
1
by: Laszlo | last post by:
Hi all, As a novice I installed PostgreSQL 7.2.1 on Win32 and works, Borland C++Builder Enterprise Suite 5.0 (build 12.34) what works too. I decided to combine these two programs and develop a...
4
by: My SQL | last post by:
Hi Can I trigger an external program to run when a new record is added to the mysql table? The external program is in C and instead of scanning the table continuously for new insertions, it...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
2
by: holysmokes99 | last post by:
I am developing a component in .Net 1.1, and want to debug it using the "start external program" of the debugger in the IDE. The program I want to start references both 1.1 and 2.0 components. The...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
2
by: lpcarignan | last post by:
Hi all, Right now, I'm debugging a C# library by starting an external application. To do this, I go in the project settings of the C# project, go in the Debug section and check the radio button...
0
by: Chico Jayanthan | last post by:
Hi, I call an external windows program (.exe) from a python script. Something like os.system('test.exe'). I want to set a timeout for the external windows program to return. If no results are...
2
by: =?Utf-8?B?YmFzaA==?= | last post by:
Hello, I am compiling a CPP code using Visual studion .net 2003. I get the following error, despite having windldap.h and wldap32.dll in my include and lib paths. Here is the error. uuid.lib...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...
1
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.