how to check for a registry value per batch and if not 0 then execute a scheduled task

as said id like a solution per batch if possible to check a certain registry value being 0 and if not for a scheduled task to be autoexecuted, thanks

0 Comments   [ + ] Show comments

Answers (3)

Posted by: flip1001 3 weeks ago
Black Belt

verify a reg value equals 0

on success, log "the value is 0"

remediation, SCHTASKS /RUN /TN "taskname"

  • uhh ok , have an example batch , cause i really dont get how its supposed to look - tobsto occupied 3 weeks ago
Posted by: rileyz 2 weeks ago
Red Belt

Here it is in PowerShell!  

if ((Get-ItemProperty -Path 'HKCU:\Software' -Name Test).Test -eq 0) {
    Write-Output 'Reg key was 0, run task.'
    & SCHTASKS /RUN /TN 'taskname'
else {
    Write-Output 'Nothing to do here...'
Posted by: tobsto occupied 2 weeks ago
White Belt


Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ