DigDeep Posted October 28, 2016 Share Posted October 28, 2016 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) Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 28, 2016 Moderators Share Posted October 28, 2016 Change the /c to a /k so the window stays open and you can see the error message in the command window "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
jguinch Posted October 28, 2016 Share Posted October 28, 2016 (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 October 29, 2016 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now