Hello want to use wmic to unistall a program the problem is that the program is stored in:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
And wmic can only view by default:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall
Can you find a way to unistall apps in:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
using wmic?
I have seen some posts regarding this problem:
Also found this might be helpfull:
I really need to use wmic for uninstall the program can anyone help me?
Can anyone create a small function in cpp to set WMIC on HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall as default?
I know it is hard, any help would be great!!!
Doing what you are asking for is documented under Requesting WMI Data on a 64-bit Platform:
C++ applications can use the IWbemContext interface with IWbemServices::ExecMethod to communicate the use of a nondefault provider to WMI.
Related
I'm trying to write a script that incorporates a retrieved Drive Serial Number for a report. So far I've just been trying to get a WMI call or really anything to even retrieve it in the first place
WMIC PATH CIM_PhysicalMedia
works on some computers but not in the WinPE environment I need it to work on. I keep getting: Invalid XML Content.
Every command I try, I use both CIM_PhysicalMedia and Win32_PhysicalMedia and neither work when it doesn't work.
What's funny is, the system it works on is Windows 7 Pro but it doesn't work on another PC with the same OS! Am I missing a dll or something?
Please help! Again this is supposed to work in a WinPE environment. I do not know the version but I do know that WMIC works normally.
Please help!!
PS I have experience with simple WMI calls like wmic bios get serialnumber and the like but I have never messed with anything this apparently complex.
I have not tested on Windows PE environment. Give it a try. Let me know if it works or not. Run below mentioned using powershell.
Get-WmiObject -Class Win32_DiskDrive | Select serialNumber
I have an issue where I am trying to use my previous knowledge of programming to write a Minecraft launcher. I have use of commands that are in the standard C++ libraries and any Python eggs that are not huge. I would prefer to use system("java ...") in order to launch Minecraft.
The question in short:
How do I launch Minecraft from the command line without any auxillary Java code? (Without using launcher code like net.minecraft.LauncherFrame) Is it possible? I tried java -cp mine craft.jar net.minecraft.client.Minecraft from the Terminal in Mac OS X, to no avail, ending with a ClassNotFoundException.
Can anyone shed some light on my problem?
Thank you,
Pyro.
I'm running on linux, but this also should work for you:
java -cp ".minecraft/bin/*" -Djava.library.path=".minecraft/bin/natives/" net.minecraft.client.Minecraft "username" "login id"
You don't need to input your username/login id, but if you don't, you can't get in any servers.
You can get your login id here: https://login.minecraft.net?user=<username>&password=<password>&version=13
More info about the authentication scheme here
UPDATE:
The new launcher for minecraft 1.6 changed a lot.
For the launch command you should look in .minecraft/versions/<version>/<version>.json
The authentication also changed. It now uses POST parameters and returns JSON. More about it here.
I am coding one project, which needs to launch some webbrowsers with the given url.
I saw some QT examples, but they explained how to launch the default browser, not a particular browser.
Any helping suggestions will be appreciated.
Edit1:
Below is the code I use currently
QString temp="C:/Program Files/Internet Explorer/iexplore.exe";
process->start(temp.toStdString().c_str());
Edit2
Hi, I found that the problem is not in QProcess->start, Because it works perfectly for "explorer.exe", But not works, for executables which are in Program Files.
So I post a new question about it.
If you know which browser you want to start and where they are located on the system (such as the default installation directories). You should be able to use QProcess
This can usually be done as the following:
iexplore.exe http://www.locationOfUrl.com
or
//path/to/app/firefox.exe http://www.locationOfUrl.com
system("/path/to/the/browser \"http://www.the.com/url\"");
or spawn instead of system (gives you control over environment variables, etc.)
I need a tool which will discover whether an arbitrary process is running in x86 or x64 mode on a machine. I need to do this programatically from C++, based on a process ID.
There has to be some way to do this (as you can clearly see it from the task manager). Does anyone know of a windows api that will tell you, given a process ID, whether the application is running under wow64?
Another approach would be to figure out, based on the process id, the executable name/path that is running and try to read the PE headers out of the file. Does anyone have a code snippet that would accomplish that?
There is a WinAPI function, IsWow64Process.
I'm working on a Command Line app to help me on launchd tasks to know if a task is running by returning a BOOL, the problem comes when i need to do a command line and obtain the output for further parsing.
i'm coding it in C/C++ so i can't use NSTask for it, any ideas on how to achieve the goal?
The Command
sudo launchctl list -x [job_label]
If i use system(), i'm unable to get the output so in further research I came with popen(), but no success there.
Thanks in advance.
You'll want to create a pipe from which you can read the output of the program. This will involve using pipe, fork, exec*, and maybe even dup. There's a good tutorial on the linux documentation project.
You can do it the home-brew way with pipe(), fork(), and the exec*() family of functions, or you could use popen() if its constraints meet your requirements.