Jump to content

Recommended Posts

Posted

Can someone please help here. Command runs correctly in CMD but doesn't do anything here.

Looks like I am not putting the ' /c ' correctly.

Local $TPM = 'wmic /namespace:\\root\cimv2\security\microsofttpm path win32_tpm get IsEnabled_InitialValue > C:\Temp\TPMStatus.log'
    Run(@ComSpec & ' /c ' & $TPM, "", @SW_HIDE)

 

Posted (edited)

You must use #RequireAdmin if the UAC is enabled.

Also, you can get the error stream with 2>&1 :

#RequireAdmin
Local $TPM = 'wmic /namespace:\\root\cimv2\security\microsofttpm path win32_tpm get IsEnabled_InitialValue > C:\Temp\TPMStatus.log 2>>&1'
Run(@ComSpec & ' /c ' & $TPM, "", @SW_HIDE)

 

Edited by jguinch

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...