The McAfee agent launches cmd /c calc under the system account. In order to work the batch file should have no user interaction or wait for something to close. Instead of opening the calc try something like creating a directory to see if it get pass the verifying
Here is the information about the two values
Product Detection Key:
The Product Detection Key field dictates the registry location that contains the “Product Detection Key Value”. In the EEDK Tool, abbreviate top-level key names. (Example – HKEY_LOCAL_MACHINE should be abbreviated to HKLM)
Product Detection Key Value:
The Product Detection Key Value is the registry value that is checked for existence within the Product Detection Key prior to the product deployment task being executed. If the value does exist, then the product deployment task will not be executed. This setting does not attempt to determine the value data, only that the registry value exists. This field cannot be left blank, so either an actual value or nonexistent value must be listed. If a nonexistent value is entered then the product deployment task will never find any value that would prevent it from executing fully.
You were right tfk23! I tried it creating a folder and it worked.
Now I have another problem which maybe regarding same issue of running as system account:
I wrote a script that uses wmic.exe to get the name of the enabled network connection on the computer, put it in a variable and then uses that variable in a netsh command to disable that connection.
I also want for the user to get some kind of message, of popup on screen.
How can I incorporate it to the batch file, if it runs under the System account?
I don't think you'll be able to generate a popup for the user because your running under the system account.
Below is an example of how to incorporate a vbs script into the a batch file.
:: Set path to current product folder
:: Get software package source directory and set as variable SRCDIR
for /f "delims=" %%a in ('cd') do @set SRCDIR=%%a
Exit /B 0
Dim wshShell, command
On Error Resume Next
Set wshShell = WScript.CreateObject("WScript.Shell")
command = "netsh advfirewall firewall set rule group=""Remote Desktop"" new enable=Yes"
wshShell.Run command, 0, False
On Error Goto 0