<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[reverse Trigger Cmd]]></title><description><![CDATA[<p dir="auto">I have finally found trigger cmd and love it, now I want to got the other way, have actions on my computer ( file  write, application open...) cause a trigger on IFTTT or Alexa...<br />
anyone know how</p>
]]></description><link>https://www.triggercmd.com/forum/topic/610/reverse-trigger-cmd</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 22:02:09 GMT</lastBuildDate><atom:link href="https://www.triggercmd.com/forum/topic/610.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Feb 2020 21:53:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to reverse Trigger Cmd on Thu, 06 Feb 2020 18:55:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/2871">@F4u5t</a>, here's an example to watch a folder for new files, and call the IFTTT webhook.</p>
<pre><code>$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = 'D:\folder_to_watch'
$watcher.IncludeSubdirectories = $true
$watcher.EnableRaisingEvents = $true

$action =
{
    $path = $event.SourceEventArgs.FullPath
    $changetype = $event.SourceEventArgs.ChangeType
    Write-Host "$path was $changetype at $(get-date)"

    $postdata = @{
        value1=$path
        value2=$changetype
    }
    
    # To get your key, click the Documentation link at https://ifttt.com/maker_webhooks/
    $key="your_ifttt_key"
    $event="new_file"
    
    $json = $postdata | ConvertTo-Json
    $response = Invoke-RestMethod "https://maker.ifttt.com/trigger/$event/with/key/$key" -Method Post -Body $json -ContentType 'application/json'
    write-host $response

}

Register-ObjectEvent $watcher 'Created' -Action $action

"Waiting for events.  Press CTRL-C to quit."
while($true)
{
    Start-Sleep .5
}
</code></pre>
]]></description><link>https://www.triggercmd.com/forum/post/1890</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/1890</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Thu, 06 Feb 2020 18:55:37 GMT</pubDate></item><item><title><![CDATA[Reply to reverse Trigger Cmd on Thu, 06 Feb 2020 17:55:38 GMT]]></title><description><![CDATA[<p dir="auto">that is fantastic, Thank you!    I've been learning much since stumbling on Triggercmd...I would love a example of a file write, and IFTTT would be sweet also.<br />
To be honest, ive never done much with Powershell, and its been years since i wrote batch files, I'm mainly c# nowadays</p>
]]></description><link>https://www.triggercmd.com/forum/post/1889</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/1889</guid><dc:creator><![CDATA[F4u5t]]></dc:creator><pubDate>Thu, 06 Feb 2020 17:55:38 GMT</pubDate></item><item><title><![CDATA[Reply to reverse Trigger Cmd on Thu, 06 Feb 2020 18:50:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://www.triggercmd.com/forum/uid/2871">@F4u5t</a>, the sendresult.bat script is meant for sending a small bit of data that your command produces back to the server.  I don't think that matches your original post's use case.</p>
<p dir="auto">Here's a Powershell script you could use to watch for new processes, and call an API when one of the processes you're looking for launches.  I had it call the TRIGGERcmd API, but you could easily switch it to the IFTTT Webhooks API.</p>
<p dir="auto">Let me know if you want a file write example too.</p>
<pre><code># Define event Query
# $query = "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance ISA 'Win32_NTLogEvent' "
$query = "SELECT * FROM Win32_ProcessStartTrace"

&lt;# Register for event - also specify an action that displays the event when the event fires.#&gt;
Register-WmiEvent -Source Demo1 -Query $query -Action {
        $processes = "mspaint.exe","calculator.exe"

        # Use this if reading Win32_NTLogEvent's:
        #  $event.SourceEventArgs.NewEvent.TargetInstance.Message
        $p = $event.SourceEventArgs.NewEvent.Properties["ProcessName"].value

        foreach ($process in $processes) {
            if ($p -eq $process) {
                Write-Host "$p launched.  Calling API."
                
                $postdata = @{
                    trigger='notepad'
                    computer='RussHP'
                    # params='optionalparameter.txt'
                }
                
                $token=Get-Content ~\.TRIGGERcmdData\token.tkn
                
                $headers = New-Object "System.Collections.Generic.Dictionary&lsqb;&lsqb;String],[String&rsqb;&rsqb;"
                $headers.Add("authorization", "Bearer " + $token)
                
                $json = $postdata | ConvertTo-Json
                $response = Invoke-RestMethod 'https://www.triggercmd.com/api/run/triggerSave' -Method Post -Body $json -ContentType 'application/json' -Headers $headers
                write-host $response
            }
        }
    }

"Waiting for events.  Press CTRL-C to quit."
while($true)
{
    Start-Sleep .5
}
</code></pre>
<p dir="auto">The <a href="https://docs.microsoft.com/en-us/windows/win32/wmisdk/receiving-a-wmi-event" rel="nofollow ugc">script I based this one on</a> watched for entries in Event Viewer.  I left those bits remarked out in case you might have that use case.</p>
]]></description><link>https://www.triggercmd.com/forum/post/1887</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/1887</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Thu, 06 Feb 2020 18:50:44 GMT</pubDate></item><item><title><![CDATA[Reply to reverse Trigger Cmd on Thu, 06 Feb 2020 14:03:46 GMT]]></title><description><![CDATA[<p dir="auto">I think i can basically accomplish what I want with sendresult.bat</p>
]]></description><link>https://www.triggercmd.com/forum/post/1886</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/1886</guid><dc:creator><![CDATA[F4u5t]]></dc:creator><pubDate>Thu, 06 Feb 2020 14:03:46 GMT</pubDate></item></channel></rss>