Click here to Skip to main content
15,867,889 members
Everything / Process

Process

process

Great Reads

by Dan Sporici
This article discusses the idea of Hot Patching C/C++ functions using Intel Pin in order to remove known vulnerabilities
by Afzaal Ahmad Zeeshan
Introduction and Background As the title suggests, this post is a personal recommendation for the users of Microsoft Cognitive Services, the services that provide a cloud-based subscription-based solution for artificially intelligent software applications, with an any team, any purpose and any scale
by Leonid Chashnikov
Discover an efficient way to implement document search using inverted index
by ASP.NET Community
The FileSystemWatcher is responsible for to track the updates of either file or folder/sub-folders, Suppose if I would like to continuously monitor a

Latest Articles

by Leonid Chashnikov
Discover an efficient way to implement document search using inverted index
by Bhargav Technical Lead
Angular migration to version 16
by ToughDev
Fix high Windows memory usage caused by large metafile

All Articles

Sort by Score

Process 

18 Jan 2011 by OriginalGriff
No, you can't disable the paging system for an application.You may actually make things worse: you do realize that disk accesses are cached as well?
7 Nov 2011 by LanFanNinja
Solution 1 will work just fine for your need. But I just wanted to add that if the windows happens to be minimized you will need to use something like this:[System.Runtime.InteropServices.DllImport("User32.dll")]private static extern bool SetForegroundWindow(IntPtr...
29 Apr 2012 by OriginalGriff
Because they are part of what is called the execution Context. Basically, when a thread is suspended for whatever reason, the current machine state (all registers, including program counter, stack pointer and flag values) are saves as part of the Context with the Thread. The actual machine...
11 Jun 2012 by Sergey Alexandrovich Kryukov
Please see my comments to the question. There must be a call to Thread.Abort somewhere. And your dedicate thread and the wait for the termination of the child process should have a reason, but this is not shown in your code.Exceptions are not errors. (Important point many developers miss.)...
27 Aug 2019 by Dan Sporici
This article discusses the idea of Hot Patching C/C++ functions using Intel Pin in order to remove known vulnerabilities
9 May 2012 by Sergey Alexandrovich Kryukov
I hope you won't be able to kill them all, it cannot make any sense, anyway, but why would I care if you want to screw up your system? You will reboot it (because you hardly will be able to work at all if you kill some of the critically important applications).Whatever. Those are not...
18 Jan 2011 by Espen Harlinn
OriginalGriff has a good point, and it sounds like you possibly could benefit from using the MemoryMappedFile Class[^] to provide the required functionality. It's just a thought :)RegardsEspen Harlinn
25 Jun 2011 by Sergey Alexandrovich Kryukov
There is no such things as "dos command" in Windows. What are your trying to do in ASP.NET makes no sense at all and would be extremely bad in general.You need to use System.IO.Directory.GetFiles, see http://msdn.microsoft.com/en-us/library/system.io.directory.aspx[^].There is a little...
9 Jun 2012 by Aescleal
If the process you're looking for has a GUI then you can use FindWindow to see if the window exists. If it does, the process is running. If not it doesn't necessarily mean it's not - it could be running in a different window station.If you can modify the source code for the process you want...
7 Aug 2012 by pasztorpisti
I never did such a hack but I guess you are searching for something like this:Hooking the native API and controlling process creation on a system-wide basis[^]Read the user comments too below the article! Those might also contain some useful info for you. Usually antivirus software does what...
1 May 2015 by Sergey Alexandrovich Kryukov
You absolutely don't need P/Invoke to kill a process. All you need is the class System.Diagnostics.Process:https://msdn.microsoft.com/en-us/library/system.diagnostics.process%28v=vs.110%29.aspx[^].As you can see, you can list all the processes, choose one (but how? doing it by name does...
18 Jan 2011 by E.F. Nijboer
You can however lock it into physical memory using VirtualLock. I have not tried to lock the program (code section) but you could give it a try. Be aware that you must first get the right to write to that memory using VirtualProtectEx because normally that would have the PAGE_NOACCESS attribute....
21 Mar 2011 by Olivier Levrey
Did you try Process.Exited event?Just add a handler to that event just before starting your child process.By the way: never use Application.DoEvents. You might have some unpredictable behaviors...
21 Mar 2011 by Sergey Alexandrovich Kryukov
Of course. (You must be using Dual Core CPU, otherwise it would be 100%.) As a rule of thumb, never use Application.DoEvents and never use spin wait (waiting with loop). Use a separate thread and a blocking call System.Diagnostics.Process.WaitForExit. The thread will be kept in a wait state...
7 Nov 2011 by OriginalGriff
Try: [DllImport("User32.dll")] private static extern bool SetForegroundWindow(IntPtr hWnd); private IntPtr handle; private Process process; private void button1_Click(object sender, EventArgs e) { process =...
10 Feb 2012 by Martin Arapovic
Hi,Use ProcessStartInfo and set CreateNoWindow and UseShellExecute to desired values depending what you want to achieve.Explore this links:1. CreateNoWindow in combination with UseShellExecute[^]2. ProcessStartInfo Class[^]
10 May 2012 by Wendelius
Looks a bit odd. The GetProcesses with a string parameter searches for processes on the machine passed as the parameter, see: http://msdn.microsoft.com/en-us/library/x8b2hzk8.aspx[^]. You could try Process.GetProcessesByName Method (String)[^] instead.
7 Aug 2012 by Volynsky Alex
Whenever PC is turned ON, BIOS takes the control, and it performs a lot of operations. It checks the Hardware, Ports etc and finally it loads the MBR program into memory (RAM).Now, MBR takes control of the booting process. Functions of MBR, when there is only one OS is installed in the system...
12 Jan 2018 by sdancer75
Using the code below to run an external exe file, when this app terminates, the parent window loses its focus. I want to disable the parent window to avoid any paint problems and re-activate when the WaitForSingleObject is terminated. Is there any solution for that ? What am i doing wrong...
11 Jan 2018 by Michael Haephrati
You will get more control over the new process you are creating if you use CreateProcess() instead of ShellExecuteEx() and running Update.exe in the background. SECURITY_ATTRIBUTES sa; sa.nLength = sizeof(sa); sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; PROCESS_INFORMATION...
16 Aug 2019 by Michael Haephrati
I tried to write a small POC (Win32 application) that will invoke "calc.exe" using CreateProcess() and periodically obtain the status (is it still running or was it closed) using GetExitCodeProcess(). My code is "quick and dirty" only for the purpose of finding out how to use...
19 Aug 2019 by OriginalGriff
Windows services cannot have a user interface, nor can they start or run any application which does have a user interface - because a user interface requires a user to be logged in, and services can run without a user (because they don't run under the user account; they can be run when the OS...
10 Jan 2022 by Afzaal Ahmad Zeeshan
Introduction and Background As the title suggests, this post is a personal recommendation for the users of Microsoft Cognitive Services, the services that provide a cloud-based subscription-based solution for artificially intelligent software applications, with an any team, any purpose and any scale
25 Sep 2023 by Leonid Chashnikov
Discover an efficient way to implement document search using inverted index
24 Sep 2010 by AlexKrist
Below is the class that will provide the username of the process that runs my application as an administrator. It's slow, but it's all managed code. Links to the souces of various pieces are included in the comments.Cheers,--AlexUsage:int currentProcessID =...
2 Feb 2011 by Manfred Rudolf Bihy
Since you're using asynchronous processing, what you want cannot be (simply) achieved. In your call to ConnectToServer you are starting a process and hook up to the OutputDataReceived event handler. The errors that happen inside the event handler cannot be directly propagated to the main gui thread.
3 Mar 2011 by Henry Minute
The Process class has an ExitCode property. Example here[^].I think that is what you need. :)
27 Apr 2011 by Nish Nishant
Ok, here's an alternate technique you can use:http://voidnish.wordpress.com/2004/08/09/running-your-apps-on-a-hidden-desktop/[^]The idea is to start the app in a separate desktop, so whether it's visible or not does not matter.
21 May 2011 by Sergey Alexandrovich Kryukov
You don't explain what exactly you want to monitor except creation and termination of processes. I know how to monitor it, please see my solution to this past question:How to Monitor Process Creation and Deletion[^].—SA
25 Jun 2011 by Espen Harlinn
You may find this article to be of some interest:File System Browsing in ASP.NET: New Approach vs. Old Approach[^]Best regardsEspen Harlinn
7 Jul 2011 by Prerak Patel
Simple Messenger - A C# MSN Messenger-like Chat Application[^]http://code.google.com/p/ipmessenger-dotnet/[^]
18 Dec 2011 by OriginalGriff
Depends on how you are doing it, but the best guess (i.e. the usual mistake) is that when you open the file, you don't Dispose of all the elements that are involved. If you open the file with a stream in one method, and allow the stream to go out of scope at the end, then the file is still open...
29 Apr 2012 by Pranit Kothari
Hi,At several places I have read,Quote:Each thread has its own set of CPU registers and its own stackHere, I can understand about stack, it's a data structure. But how thread can have its own CPU registers. They are fix in number and there are limitless number of threads are running...
10 May 2012 by Sergey Alexandrovich Kryukov
You can use the property System.Diagnostics.Process.HasExited. Pay attention for the exceptions this call can throw — it can help you to cover remaining situations, such as when the process has not been started,...
10 May 2012 by Sergey Alexandrovich Kryukov
[Answering the follow-up question, from the comment to the original question:]MR. AngelMendez wrote:How about closing any windows that are behind my full screen window?Of course you do it but why? It won't solve your problem.Anyway, you can use Windows API to get HWND of a desktop and...
16 May 2012 by ledtech3
I found a web page that showed a version that was converted from C# to VB.Nethttp://www.vbdotnetheaven.com/uploadfile/mahesh/access-command-line-arguments-in-VB-Net/[^]Ive tried this in VB.Net and it works Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As...
17 May 2012 by Wendelius
The quality of the proposed words highly depends on the algorithm you choose. One very straightforward is SOUNDEX[^]. Not sure if that's suitable to your needs, but have a look
17 May 2012 by Maciej Los
If you're looking for database algorithm to "catch" bad inputs, see SIMIL[^] slgorithm.
7 Jun 2012 by Tim Corey
You can use a Windows function to determine if you are running on Remote Desktop (a session) or directly on the machine (host computer). Here is a Stack Overflow question with the information you...
10 Jun 2012 by Vitaly Tomilov
I did process enumeration and searching for a process in my article here:Professional System Library: Introduction[^]You will see that the demo itself lists processes, and allows you to kill one.
6 Jul 2012 by OriginalGriff
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...A very quick search gave over three million results, the top of which was Wikipedia: http://en.wikipedia.org/wiki/Fork_(operating_system)[^] which gives a good general...
12 Aug 2012 by Mehdi Gholam
If you are using c# then it would be much better like Sergey said to do all your work in your own application instead of out in another process especially if you want to get the error messages etc.Try the following :...
13 Aug 2012 by Sergey Alexandrovich Kryukov
Please see my last comment to the answer by Mehdi. After we discussed why you need a separate process and I can see why you really might need it, let's see how you do it.The biggest problem I can see is that you totally block the propagation of exceptions, in two places. You should never do...
24 Aug 2016 by ShlomiO
Hi, had the same problem, hope this will help:The trick is to make windows ‘think’ that our process and the target window (hwnd) are related by attaching the threads (using AttachThreadInput API) and using an alternative API: BringWindowToTop.Forcing Window/Internet Explorer to the...
10 Sep 2012 by AssemblySoft
Hi MitchG92_24, this displays the first argument text along with a message in a message boxvar link = "C:\\MyVbScript.vbs";string strArgs = "\"" + "myArg1" + "\" \"" + "myArg2" + "\""; var process = System.Diagnostics.Process.Start(link,strArgs);process.WaitForExit(); // if you...
21 Oct 2012 by OriginalGriff
For obvious reasons, you can't resume a suspended process from within the process itself...The recommended way would be to use a Mutex: Mutex.WaitOne[^] - this includes a version that will "wake up" after a specified number of milliseconds.
9 Dec 2012 by Sergey Alexandrovich Kryukov
There is no such thing as "force" to run something to "run on a single process". Processes are totally under your control. If you don't create a process, it is not created by anything by itself. And using GC is not recommended.Your "without going too much into assemblies and stuff like that"...
3 Jan 2013 by Shailesh vora
Hi,I have created one website with the following code/* Following code will just access - open 100.20.20.20 Ip with specific credential and allow to access file --- START */using (System.Diagnostics.Process proc = new System.Diagnostics.Process()) { ...
10 Feb 2013 by KarstenK
Check for the windows version and do it the "Windows 7" way.Use Spy++ to detect the right name of the excel-doc
28 Mar 2013 by Sayyed Mostafa Hashemi
HiYou must check Process in Task manager by VC++ and use for statement. use GetmoduleFilename and GetModuleHandle.
23 Apr 2013 by CPallini
In priciple you can, but that's 'the recipe to disaster' according to Multiple processes write to the same file (C)[^].
31 May 2013 by ZurdoDev
You need to put the path into double quotes because there is a space in it. Also, remove the path from your fileargs.
18 Jun 2013 by Dave Kreskowiak
It's probably the length of a string that would be returned. In Win32, it's common to call certain functions and pass in a buffer or length of 0 for the function to fill. Usually, this causes the called function to return a value that tells the caller how big a buffer needs to be to hold the...
20 Jun 2013 by Zoltán Zörgő
As you have probably noticed, Windows is monitoring processes and it is tagging the dead or dead-alike ones with "not responding" flag. The framework is giving you the means to track this flag too: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.responding.aspx[^]. Still,...
11 Oct 2013 by ASP.NET Community
The FileSystemWatcher is responsible for to track the updates of either file or folder/sub-folders, Suppose if I would like to continuously monitor a
15 Oct 2013 by Sergey Alexandrovich Kryukov
This code should not even compile. The instance of Process.StartInfo should first be created; Process.Start accepts one or two arguments (if you use , and the method Process.ForExit is not static, should be called with the process instance obtained from previous call.And so on… I don't...
24 Dec 2013 by Dave Kreskowiak
Since the VB6 app has no clue what a SecureString is you can't use it to pass the password as a parameter. VB6 can't decode it. You have no choice but to pass the string in clear text.The UserName and Password fields in the ProcessStartInfo class are only used to tell Windows who to launch...
21 Jan 2014 by CPallini
Have a look at this Stack Overflow question: "Why does the window of a program called via CreateProcess show up in spite of SW_HIDE and CREATE_NO_WINDOW?"[^].
22 Jan 2014 by bling
An alternative is to create a separate window station and create the process under the new window station. Leave the current window station active. Do this only if you don't want the new process to interact with the current...
25 Mar 2014 by Babita22
#include #include #include #include #includeint main(void){ pid_t pid; int r; char buf[1024]; char cp[50]; char ans; int readpipe[2]; int writepipe[2]; long int a;...
3 Jul 2014 by TcJoshJohnson
Try something like this:// start your "oui" process and wait for it to pass control to javaw.exeProcess oui = Process.Start("oui.exe");oui.WaitForexit();// grab processes with the name "javaw"Process[] processes = Process.GetProcessesByName("javaw");// if you found one,...
11 Jul 2014 by pdoxtader
You'll have get a list of all the open windows on the machine, and wait for the message box to pop up and be in the list. Then you can select it and send an enter key to close it. Just try Googling "vb.net enumerate open windows" and you'll find many code examples.-Pete
28 Jul 2014 by pavanreddy61
Output is : Parent : xxxxxThe fork command actually creates a child process, and returns the PID of the process to the parent, and a value of zero to the child. In this example, the first block of code is executed by the parent, while the second block is executed by the child. The one thing...
31 Dec 2014 by Sergey Alexandrovich Kryukov
You cannot do it to an arbitrary already running process using command-line arguments. The process has been started already and those arguments are already obtained and processed at this moment. It's too late to change its behavior.However, you can design your process in some special way to...
30 Sep 2015 by Dave Kreskowiak
Start -> Run -> PerfMonEverything you could possibly want to capture and more.
25 Nov 2015 by George Jonsson
For dup2 you can have a look here: dup2(2) - Linux man page[^]For the code, start with an outer loop where you split the input string at the pipe character. Then create a function that takes care of the execution of the each command.#include "stdafx.h"#include #include...
1 Dec 2015 by E.F. Nijboer
You need to drain the output streams to prevent hanging. Check the links for some detailed info. http://www.rgagnon.com/javadetails/java-0014.html[^]http://steveliles.github.io/invoking_processes_from_java.html[^]Good luck!
2 May 2016 by OriginalGriff
OK....* is "any character, any number of times (including zero)".*? is "and character, any number of times (including zero), as few as possible".+? is "any character, at least one of, as few as possible".?? is "any character, zero or one of, as few as possible"And.? is "any...
17 Jun 2016 by Dave Kreskowiak
The user you impersonate has to have permissions to the network share you're trying to open the file from.Also, a UNC path is \\servername\sharename\folderpath\filename
13 Apr 2018 by Dave Kreskowiak
None of the above. All services run under a completely different desktop from the one you can see after you log in. Any application that the service launches will also show up on that service desktop. Services can no longer interact with the users desktop like you could do in Windows XP. For...
12 Mar 2019 by Gerry Schmitz
Socket Code Examples | Microsoft Docs[^]
23 Jan 2023 by leone
Ok I did it on my own: Material m=new Material(URL); process.OutputDataReceived +=(Object _sender, DataReceivedEventArgs _args)=>DoSomething(m, _sender, _args); public void DoSomething(Material mt,object sender, DataReceivedEventArgs e) { ...
16 Aug 2019 by Jim Forst
If you try another command invoked by CDM, especially one that takes time, like ipconfig, it might work. When you run calc.exe its like typing start calc.exe in CMD and calc.exe is NOT the process you start with CreateProcess()
19 Aug 2019 by Maciej Los
Please, read this: .net - How can I run an EXE program from a Windows Service using C#? - Stack Overflow[^] The most important information is: Quote: Windows Services cannot start additional applications because they are not running in the context of any particular user. Unlike regular...
28 Aug 2019 by OriginalGriff
I'm not going anywhere near that code. Try without Catch , GoTo instead of loops, two different ways to annoy the user by stopping your app running: Sleep and Nap, assumptions that "something will be finished if I just wait around long enough", ... That doesn't seem to have been thought about,...
28 Jan 2020 by Dave Kreskowiak
First, SFC required admin permissions to run, so if you're not running your code as an admin, SFC isn't going to work either. Next, you execute the SFC command with a call to .Start, but then the very next line you call .ReadToEnd, which DOES NOT WAIT FOR THE PROCESS YOU LAUNCHED TO COMPLETE!...
31 Mar 2020 by Alan N
There's nothing wrong with that code but it is possible that SW.exe is ignoring the startup state 'request' from the operating system. For example a GUI windows application written with a System.Windows.Forms.Form and a Load event handler with...
4 Dec 2020 by IAmJoshChang
Graphs are one of the most common questions that might show up in a technical interview, especially in these days where many real-world applications can be represented by nodes and edges such as the social networks!
8 Feb 2023 by Dave Kreskowiak
Your code, running as your account, cannot intercept calls being made by another account, or an elevated account. This is for security reasons. Think about it. Would you want some schmuck user intercepting code running as administrator and...
29 Nov 2023 by Dave Kreskowiak
There's a ton of possible problems that can cause this. See this SO post for a list of them: https://stackoverflow.com/questions/55086195/the-resolvepackageassets-task-failed-unexpectedly-system-typeloadexception[^]
14 Dec 2023 by Member 16163045
Idea not answer trying to block a proccess from creating you can either try killing all of its subproccesses repeatedly. note: add a delay so the users computer doesn't have a bsod (bluescreen of death). if that doesn't work or you still want...
18 Sep 2010 by moshe.h
I'm making a call to psftp.exe from inside my C#/.net 2.0 winform app: private void FtpUpload(){ Process psftp = new Process(); psftp.StartInfo.FileName = "psftp.exe"; psftp.StartInfo.Arguments = "XXX.XXX.XXX.XXX -l username -pw password -be -b " + batchFileName...
21 Sep 2010 by E.F. Nijboer
It looks like you are doing the operation from within the main thread and therefore blocking the application messageloop. This would also mean that if the operation takes to long, you would get the message that the program isn't responding anymore. A solution is to implement some threading or...
22 Sep 2010 by DaveAuld
I would have expected that if an user is running an application under a different name from the current windows user, then the application should correctly report the correct SecurityPrincipal object for that instance.Edit: 1st link didn't work??Edit2: 2nd link didn't work?? MSDN copy and...
22 Sep 2010 by Prerak Patel
I think you should useSystem.Security.Principal.WindowsIdentity.GetCurrent.NameorEnvironment.UserName
24 Sep 2010 by Abhishek Sur
Create a manifest file. Add the manifest to the application. Put the code below in your manifest :
23 Oct 2010 by Shah Rukh Qasim
I am building an MFC 6.0 application. How can I close a running process from that application like ending process from task manager? Tell me if there exists a windows API for my purpose.
23 Oct 2010 by Sauro Viti
Start from Process and Thread Functions (Windows)[^]. The specific API that you need is TerminateProcess(); the others could be useful to identify the HANDLE of the process that you want to terminate).
24 Oct 2010 by BlackBar
Hi! I'm trying to write a code which will converts doc files to docx. As far as I know, I can use ofc.exe for this purposes, but I can't run it from an aspx page. I'm impersonating the user who has unrestricted rights (user is in a group of the local administrators), but the file is not...
24 Oct 2010 by Rajesh Anuhya
Is your ofc.ini file is OK with all parameters..., check it out first , There is no Problem is code., Go through the below link for more InfoBulk Convertion from doc to Docx[^]
18 Jan 2011 by Paulo Zemek
As a general rule, I understand that. I simple prefer avoiding to explain the application in every detail as I know that disabling the pagefile solves the problem. It already works even if I disable it for the entire system, but I want to avoid that if, for some reason, the system needs to use...
19 Jan 2011 by Asif Huddani
Hi,I have application which call PGP encryption exe on server and encrypt client data.i user System.Diganosis.Process.Start(pgp.exe(MY FILE))it work properly in my devlopment machine but not when i install on IIS7 with windows server 2008.I allow IISADMIN in services to use...
2 Feb 2011 by All Time Programming
Hello, I have a class which executes a Process (runs a command line command). On receiving the output from the command execution, I want to check various lines and throw exception. My code is :************ This is a library classpublic int ConnectToServer(){ int error =...
3 Feb 2011 by Blake Miller
Is anyone aware of a utility that can display a process' virtual address space usage from a DMP file for that process?For example, if the process were currently executing, you would obtain this information using VirtualQueryEx - you could walk the entire virtual address space of the process...
3 Feb 2011 by Kythen
Well, you can definitely open up the .dmp file in WinDbg (or possibly Visual Studio) and examine the process memory.You can see the RVA and contents of the pages in a full dump, but I'm not sure you can get much information about the memory pages themselves. According to a couple of pages I...
9 Feb 2011 by All Time Programming
I found solution to achieve my goal and hence thought to share with all of you, as it might help someone.I added a new property "ErrorMessage" in class and assigned the value of line in isInvalid() if specified text is found.In process_OutputDataReceived, if isInvalid() returns true, the...
27 Apr 2011 by cl0ud
Hi,I am trying to start an hidden process in the background of my form application but it always shows visible no matter what. What am i doing wrong? :(Process SomeProgram = new Process();SomeProgram.StartInfo.FileName = @"C:\\program.exe";SomeProgram.StartInfo.Arguments = "some...
27 Apr 2011 by Nish Nishant
It's likely that the program ignores the visibility flags and always makes itself visible.
20 Jun 2011 by deepthakannan
This is my Script file. It displays all the arguments that are passed to it and their count.ScriptwithArguments.ps1========================Arguments: $($args.count)$argsI'm trying to run this script from C# Process.Start()If I say...