Finding not installed programs' processes - windows

I need to find the exact names of the processes that are running (in Task Manager) for a very long list of programs. I can install each of them and run and track the process in the Task manager. But again the list is long. So, is there any way to find it out without installing and running the program? Maybe I can find it in the files I download for installation or even before?

Related

Monitor what processes are writing to a file on Windows from Go

I am writing a Go app targeted at macOS and Windows and that needs to monitor what processes write to a file at a given path. More specifically, I need to verify that only one specific process writes to the file for the duration that my program is running. On macOS, I can monitor the file via the built-in fs_usage command. Does anyone have an idea for how to achieve equivalent monitoring on at least Windows 10 and later without requiring the user to install any additional software.
Note that I don't expect for there to exist a pure Go solution and I don't mind interoperating to achieve the desired result.

Programmatically get a list of all installed updates in Windows

I want to programmatically get a list of all installed KBs. This could be python code, WinAPI (which I will call from python), running another process and parsing its output, etc. What interests me are security updates, I don't care whether or not other updates are returned or not. However, I want updates for software as well, not just for Windows - anything that shows up in the control panel's "Installed Updates" window.
It's also important that this code will run on all versions of windows, not just a single version (I don't mind having an if-else in the code, with different behavior for different Windows versions - it's just important that eventually it works).
I tried wmic qfe, systeminfo and PowerShell's get-hotfix, all of which return only OS updates.
I have a Windows 10 myself, and I couldn't find a single place in the registry or in the file system where all KBs are listed together. Couldn't make sense of Procmon's output (after recording opening "Installed Updates") either - too large and not focused enough. It seems like different updates are listed in different places, but nothing I could easily understand how to extend/generalize.
EDIT:
I found this code: https://codereview.stackexchange.com/questions/135648/find-installed-and-available-windows-updates
I tried running it on my computer, and it found some KBs that didn't appear neither in the commandline commands I ran, nor in "Installed Updates". On the other hand, there are also KBs that don't appear there but do appear in the other locations..
Thanks!
The problem with qfe is that newer Windows versions have updates for componentes which aren't CBS related, hence wmic path Win32_QuickFixEngineering will not show them.
The trick is to use a COMObject to the updater system.
I've written a small package that does the job, and checks for updates via COM, WMI and registry.
Talking to windows update via COM gives the most information.
WMI gives some information, and registry of course only gives the KB and install date.
Install with
pip install windows_tools.updates
Use with
from windows_tools.updates import get_windows_updates
for update in get_windows_updates(filter_duplicates=True):
print(update)
The duplicate filter is enabled because of AV definition updates that show alot.

How can I see all the processes that were run during a specific time period

I know that PS will show me all the currently running processes. But that won't show me anything that's started, then stopped, during some time span. Is there any other way that I can see all the processes that were run during some event?
I'm trying to setup a way of auditing all the processes that ran during a build compilation. I can use PS to check all the running processes at the start of the build, and even run it again at the end. And I can setup a separate thread that will run PS over and over and over again during the build to catch all the processes that might have been run in the middle. But is there some better way of accomplishing this task that I'm not aware of?
This build is being run on a mac, so it uses the mac version of bash.
After your processes have run you can go to the Console (in the Applications/Utilities Folder) and check the system logs for the time period of interest. Many messages are written so the narrower the time window the better.

Scripting for safe file backup under windows

I need to back up some large files that are being written to disk by a process. The process is perpetually running, and occasionally dumps large files that need to be moved over the network. Having the process do this itself is not an option, as the process locks out users whilst it is doing file dumps.
So, this runs under a windows machine, and as a primarily linux user, I am not entirely certain how to do this...
Under linux I would simply use a cron job in the folder (I know the glob that will match the output files), then check lsof, to ensure that the file is not being written to, such that I don't try to copy a partially complete file. Data integrity is critical, so I would normally md5 the files before and after the copy.
So I guess my question is -- how does one do this sort of stuff under windows? I feel like I am kneecapped from the start -- I can use python, but I can't emulate lsof, nor cron to do the task scheduling.
I tried looking at "handle" -- but it needs admin privelidges at execution time, which is also not an option. I can't run the backup process as an admin, it has to run with user privs.
Thanks..
Edit: I just realised I could keep the python instance running, with a sleep, so task scheduling is not a problem :)
For replacing cron you can use the "Task Scheduler" in windows to start your script every few minutes (or specific times).
For lsof the question was discussed here : How can I determine whether a specific file is open in Windows?

Does an application installer OUTPUT anything?

For example if App-A tries to installed App-B. Is there any way for App-A to know when App-B is finished installing and can be run?
update
to be specific I am trying to install ChromeSetup.exe on windows using AIR 2.
update 2
Good information guys, after reviewing all your answers is seems like I should run the installer with the -ms argument so it installs silently. Then listen for the NativeProcessExitEvent.Exit event. I will try that and see if it works.
It Depends (TM).
Most of the time, the installer for an app is a single executable - so you can launch it and wait until execution comes back to you, but I've seen some unholy messes like "downloader unpacker -> installer downloader -> installer unpacker -> installer" which launched the next executable in the background. Try it with the specific apps you're after and see if the simple system() method works. If not, you'd have to monitor the process list to see if the other installer is done yet.
Installers generally generate logs that give output for events during install. It may be possible in your case to search for a generated log file from App-B installer and look at it to gauge success or failure. But if you're just running the App-B installer as a command line executable you could just invoke it synchronously and wait on it to complete.
Typically the installer would just exit and the system() call would return.
Or you can script installers and their own scripting language would control the sequence.
Generally speaking, the installer will run as a process, and you can wait for that process to finish. Under POSIX you can use spawn, and quite a few other systems provide the same or least something quite similar.
If I understand well, you are writing an installer and you want to install Chrome as a pre-requisite or something like that?
If so, you can run the installer silently with the "-ms" parameter according to what I could see on the Web.
Then how to call it depends on which programming language or system you're writing the installer on: for example, from a batch file, you would do
start /wait "" GoogleSetup.exe -ms
but how to call a separate process and wait for its termination depends on the development language and system you're using. Most of them offer functions to launch external processes and wait for their termination almost effortlessly.

Resources