Simple Technical tips and tricks

1. How to know AntiVirus is running on your machine?

Get instances of the WMI class "AntiVirusProduct" in the namespace "\root\SecurityCenter" Whish is the list of AntiVirus.

2. How to know whether Least user access Privilege(LUA) is enabled on a computer or not?

Look for  value of the property "EnableLUA"  of the registry key HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System and the value indicates the status of LUA on the machine.

3. How to identify whether an assembly was build to target at 32 bit platforms or 64 bit platforms?

This information is available for programs through  NT Headers that is present in the assembly file. copy the Assembly to 32 bit machine and execute the assembly, if the assembly fails on 32 bit machine and runs success on 64 bit machine, you know that assembly is targeted to run on 64 bit platforms.

4.  How to identify whether a 32 bit installer or 64 bit installer of application has been installed on a 64 bit machine?

If the  application was installed under ProgramFiles, it is 64 bit installer and if it is installed under ProgramFilesx86, then it is 32 bit application installer.

5. How to identify productID from from installer package?

Run MSI query SELECT Property, Value FROM Property WHERE Property = ‘ProductCode’"  on the MSI database.

6. How to invoke one process from another process with command line arguments and get results though a program?

Once you make use of .Net Process class to execute the second process. Wait for the process to exit by calling process.WaitForExit().

Do not read the second process output till the second process has been exited. Then check whether process.ExitCode == 0 which indicates success and then read the results using process.StandardOutput.ReadToEnd()

7. How to make sure that an assemblt is signed?

Invoke signtool.exe that is available in Windows SDK  with verify option and  assembly whose signature status has to be verified. signtool.exe provides the signature status of an assembly.