Can't get custom task to work with bluetooth device connected as triggger

MGsubbie 25 Reputation points
2023-02-18T12:15:56.75+00:00

I use a Bluetooth device paired with software specifically for it. I have already created a custom task to run the software and bypass the UAC prompt by having it run at the highest privileges. and created a shortcut for it. Those work without issue. I now want to automate the software starting when I connect the device. I have used Event Viewer to find the Log Name, Source, and Event ID, which I then entered in the trigger. It will not work, however.

Screenshot_20230218_002838

Screenshot_20230218_003031

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
11,195 questions
0 comments No comments
{count} vote

Accepted answer
  1. MotoX80 35,626 Reputation points
    2023-02-18T13:12:26.0033333+00:00

    It will not work,

    What specifically doesn't work? Does the task scheduler not launch the task? Or does the program you execute fail to launch the software?

    Verify that you have enabled task history. If you see the option to disable the history, then you have it enabled.

    User's image

    Is the task set to execute as your account and do you have it set to "run only when the user is logged on"?

    What program does the task run? If the task scheduler is launching the task, then you need to capture the output of whatever program you are running. Create a bat file that executes your program. Echo %date% %time% as the first and last line the .bat so that know when the task starts and ends.

    @echo %date% - %time% MyScript is starting.
    SomeProgram.exe  
    @echo %date% - %time% MyScript is ending. SomeProgram RC=%errorlevel%  
    

    Then change the scheduled task to execute program "cmd.exe".

    In the arguments field set it like this example:

    /c C:\Scripts\MyScript.bat 1>>"C:\Scripts\Logs\MyScript-%date:~10,4%-%date:~4,2%%date:~7,2%.log" 2>&1

    That will create a daily log file of all executions of the task. That will capture stdout and stderr for programs that get called.

    2 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. MGsubbie 25 Reputation points
    2023-02-18T16:35:56.23+00:00

    The software is DS4Windows. I did not have task history enabled, I have enabled it now. However, I am not seeing all the same
    things you are.

    Screenshot_20230218_162308

    It was set to only run when user is logged on, yes. I can't et it to run otherwise so far.

    Are you saying I should create a separate task to start the software, and a separate task to run the the trigger?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.